Rails Frontend Tips You Should Know

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Favorites & 2 Groups

    Rails Frontend Tips You Should Know - Presentation Transcript

    1. Frontend Tips hlb@handlino.com http://iamhlb.com
    2. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>something</title> <%= stylesheet_link_tag "reset", "application", :cache => 'all' %> </head> <!--[if lt IE 7 ]> <body class="ie6"><![endif]--> <!--[if gte IE 7 ]> <body class="ie"><![endif]--> <!--[if !IE]>--> <body> <!--<![endif]--> <div id="container"> <%= yield %> </div> <%= javascript_include_tag "jquery-1.3.2.min.js", "application", :cache => 'all' %> <%= yield(:page_specific_javascript) %> </body> </html>
    3. Always close your html tags <foo></foo>
    4. valid HTML 4 + 5 <!DOCTYPE html> <html>
    5. Conditional Comment <!--[if lt IE 7 ]> <body class="ie6"><![endif]--> <!--[if gte IE 7 ]> <body class="ie"><![endif]--> <!--[if !IE]>--> <body> <!--<![endif]-->
    6. Yahoo’s Exceptional Performance http://developer.yahoo.com/performance/
    7. Yahoo’s Exceptional Performance • Make Fewer HTTP Requests • Put Stylesheets at the Top • Put Scripts at the Bottom
    8. Yahoo’s Exceptional Performance • Make Fewer HTTP Requests • Put Stylesheets at the Top • Put Scripts at the Bottom <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>something</title> <%= stylesheet_link_tag "reset", "application", :cache => 'all' %> </head>
    9. Yahoo’s Exceptional Performance • Make Fewer HTTP Requests • Put Stylesheets at the Top • Put Scripts at the Bottom <%= javascript_include_tag "jquery-1.3.2.min.js", "application", :cache => 'all' %> <%= yield(:page_specific_javascript) %> </body>
    10. // html code... <% content_for :page_specific_javascript do %> <script type="text/javascript"> $(function() { var loader = new YAHOO.util.YUILoader({ base: SUDA._YUI_PATH, rollup: true, require: ['paginator','datasource','datatable'], onSuccess: function() { // logic here } }); loader.insert(); }); </script> <% end %>
    11. <%= render :partial => "...", :locals => { ... } %> // html code... <% content_for :page_specific_javascript do %> <script type="text/javascript"> $(function() { // logic here }); </script> <% end %> // html code... <% content_for :page_specific_javascript do %> <script type="text/javascript"> $(function() { // logic here }); </script> <% end %>
    12. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>something</title> <%= stylesheet_link_tag "reset", "application", :cache => 'all' %> </head> <!--[if lt IE 7 ]> <body class="ie6"><![endif]--> <!--[if gte IE 7 ]> <body class="ie"><![endif]--> <!--[if !IE]>--> <body> <!--<![endif]--> <div id="container"> <%= yield %> </div> <%= javascript_include_tag "jquery-1.3.2.min.js", "application", :cache => 'all' %> <%= yield(:page_specific_javascript) %> </body> </html>
    13. http://www.flickr.com/photos/robotjohnny/3629069606/
    14. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>something</title> <%= stylesheet_link_tag "reset", "application", :cache => 'all' %> </head> <body> <!--[if lt IE 7]> <h1> IE 7 Firefox, Safari, Opera </h1> <![endif]--> <div id="container"> <%= yield %> </div> <%= javascript_include_tag "jquery-1.3.2.min.js", "application", :cache => 'all' %> <%= yield(:page_specific_javascript) %> </body> </html>
    15. THE END

    + Liang-Bin HsuehLiang-Bin Hsueh, 5 months ago

    custom

    619 views, 2 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 619
      • 619 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 2
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events