Results 1 to 10 of 10

Thread: Do What G Does

  1. #1
    Andy101's Avatar
    Andy101 is online now Code Otaku
    Join Date
    Aug 2009
    Location
    Kanazawa
    Posts
    1,314
    Thanks
    178
    Thanked 309 Times in 236 Posts

    Do What G Does

    Let's share simple HTML code templates to replicate what big G does.

    e.g.

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Gmail</title>
    <meta name="description" content="The description about what is to follow">
    </head>
    <body >
    For the header of a web page.
    Otaku CMS - Import a WordPress blog and manage your site using single-page App technology
    Angular Skills - new site about Front-end App. programming

  2. #2
    Aziz's Avatar
    Aziz is offline no investment, no glory
    Join Date
    May 2009
    Location
    IL
    Posts
    736
    Thanks
    588
    Thanked 243 Times in 168 Posts
    HTML5
    does it have to be based on Goolge tho?

    P.S what do you think the source code of my homepage? www.aziznatour.com
    Last edited by Aziz; 31 October, 2010 at 16:02 PM. Reason: I CAN'T TYPE MY OWN NAME PROPERLY

  3. #3
    Aquarezz's Avatar
    Aquarezz is offline Master Net Builder
    Join Date
    Dec 2008
    Location
    Belgium
    Posts
    3,853
    Blog Entries
    4
    Thanks
    683
    Thanked 591 Times in 463 Posts
    Quote Originally Posted by Aziz View Post
    HTML5
    does it have to be based on Goolge tho?

    P.S what do you think the source code of my homepage? www.aziznaotur.com
    Corrected version: www.aziznatour.com
    |Nico Lawsons

  4. Thanked by:

    Aziz (31 October, 2010)

  5. #4
    Andy101's Avatar
    Andy101 is online now Code Otaku
    Join Date
    Aug 2009
    Location
    Kanazawa
    Posts
    1,314
    Thanks
    178
    Thanked 309 Times in 236 Posts
    P.S what do you think the source code of my homepage? www.aziznatour.com
    Aziz, your code looks neatly laid out. But I would move the Javascript from the header to the end of the web page code since it should be loaded last.

    I'm interested in looking at how Google does things since they don't always obey the "rules" of coding and are heavily into web page speed, especially with delivering search results.

    The search page has almost no HTML:

    Code:
    <!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title><script>Some code</script>
    Extreme on-page SEO maybe?
    Otaku CMS - Import a WordPress blog and manage your site using single-page App technology
    Angular Skills - new site about Front-end App. programming

  6. #5
    Aziz's Avatar
    Aziz is offline no investment, no glory
    Join Date
    May 2009
    Location
    IL
    Posts
    736
    Thanks
    588
    Thanked 243 Times in 168 Posts
    Quote Originally Posted by Andy101 View Post
    Aziz, your code looks neatly laid out. But I would move the Javascript from the header to the end of the web page code since it should be loaded last.

    I'm interested in looking at how Google does things since they don't always obey the "rules" of coding and are heavily into web page speed, especially with delivering search results.

    The search page has almost no HTML:

    Code:
    <!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title><script>Some code</script>
    Extreme on-page SEO maybe?
    it is funny, Google suggests to place javascript "before the closing of the <head> tag"

  7. #6
    Andy101's Avatar
    Andy101 is online now Code Otaku
    Join Date
    Aug 2009
    Location
    Kanazawa
    Posts
    1,314
    Thanks
    178
    Thanked 309 Times in 236 Posts
    it is funny, Google suggests to place javascript "before the closing of the <head> tag"
    They would do so that their tracking script gets priority, but a website visitor wants to view the page content before any javascripts run.
    Otaku CMS - Import a WordPress blog and manage your site using single-page App technology
    Angular Skills - new site about Front-end App. programming

  8. #7
    Aziz's Avatar
    Aziz is offline no investment, no glory
    Join Date
    May 2009
    Location
    IL
    Posts
    736
    Thanks
    588
    Thanked 243 Times in 168 Posts
    Quote Originally Posted by Andy101 View Post
    They would do so that their tracking script gets priority, but a website visitor wants to view the page content before any javascripts run.
    So you would suggest that I move all javascripts before the end of the body tag and keep Googe Analytics up there?

  9. #8
    Andy101's Avatar
    Andy101 is online now Code Otaku
    Join Date
    Aug 2009
    Location
    Kanazawa
    Posts
    1,314
    Thanks
    178
    Thanked 309 Times in 236 Posts
    So you would suggest that I move all javascripts before the end of the body tag and keep Googe Analytics up there?
    Yes, for fastest web page content delivery, you need to position all javascripts before the end of the body tag.

    The Javascripts can call on external scripts to run, and until they are completed, the rendering of the web page will be paused which is a bad thing for your website visitors.
    Otaku CMS - Import a WordPress blog and manage your site using single-page App technology
    Angular Skills - new site about Front-end App. programming

  10. Thanked by:

    Aziz (2 November, 2010)

  11. #9
    Social-Media is offline Search Marketing Consultant
    Join Date
    Mar 2010
    Posts
    61
    Thanks
    0
    Thanked 23 Times in 21 Posts
    Andy is correct. When possible, all Javascript definitions should appear at the END of your page just before the </body> element. It's probably less important now than in the past when Google used to only index the first 100K or so of a page... but its still good practice.

    What's even a better practice is to define all Javascript functions (where possible) in EXTERNAL JS files to increase the content:code ratio of the page... and because it's just good coding practices.

    Why define the same function over and over in every page of your site when you can put it in an external file and reference that file using <link> from all of your pages? If you need to change a function that is hardcoded in every page of the site, you'll have to edit every page on the site... versus editting ONE copy of the function in an external JS file and have the new definition picked up automatically by all pages on the site through the <link> element for that script file.

  12. #10
    TopDogger's Avatar
    TopDogger is offline Über Hund
    Join Date
    Jan 2009
    Location
    Hellfire, AZ
    Posts
    3,106
    Thanks
    350
    Thanked 919 Times in 703 Posts
    Quote Originally Posted by Abhishek01 View Post
    that's mean google always trying to keep their pages clean and clear to understand
    Have you ever looked at the code for Google's home page? It is loaded with errors and uses old, outdated coding standards and violates several rules for the code structure of a page.
    "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •