JavaScript Introduction?

Discussion in 'JavaScript' started by Johnletton, Jul 21, 2011.

  1. #1
    JavaScript Introduction? Define, use and purpose. how can we reduce the web page loading time as far as javascript is concerned.
     
    Johnletton, Jul 21, 2011 IP
  2. MarPlo

    MarPlo Member

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    48
    #2
    Hy,
    Try to include all javascript code into one or two .js files, and use cache in htaccess:
    
    # cache text, css, and javascript files for one week
    <FilesMatch ".(js|css|pdf)$">
    Header set Cache-Control "max-age=604800"
    </FilesMatch>
    
    # cache html and htm files for one day
    <FilesMatch ".(html|htm)$">
    Header set Cache-Control "max-age=43200"
    </FilesMatch>
    
    Code (markup):
     
    MarPlo, Jul 23, 2011 IP
  3. JLDouglas

    JLDouglas Peon

    Messages:
    14
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    JavaScript is a scripting language that adds interactivity to HTML sites. There are numerous uses for it. Everything from embedding to detecting a visitor's browser (so your site uploads differently) can be done with JavaScript.

    There are two main ways to reduce page loading time. One, minimize onpage JavaScript usage and have them written on a separate file; two, compress your JavaScript (this is easy but often overlooked). Removing white spaces in your JavaScript reduces the size of data transferred; compressing the scripts (using tools like GZIP) easily cut half of the current size and thus free up some bandwidth.
     
    JLDouglas, Jul 23, 2011 IP
  4. Johnletton

    Johnletton Member

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #4
    How can we minimize the use of Javascript. Actually i am new in this field so give me some basic and high profile references regarding Javascript i wanted to read about it.
     
    Johnletton, Jul 24, 2011 IP
  5. unknownpray

    unknownpray Active Member

    Messages:
    3,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    70
    #5
    HELLO
    JAVAScript is THE scripting language of the Web.JavaScript is used in billions of Web pages to add functionality, validate forms, communicate with the server, and much more.JavaScript's use in applications outside web pages—for example in PDF documents, site-specific browsers, and desktop widgets is also significant. fetching a small amountof javascript from the server and alter the existing page by this we can decreace the load time Hope you got answer!
     
    unknownpray, Jul 25, 2011 IP
  6. JLDouglas

    JLDouglas Peon

    Messages:
    14
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It depends on what it's needed for. JavaScript is THE scripting language of the web. check out "http://www.w3schools.com/js/default.asp" for a detailed introduction and examples.

    you can also check out "http://www.dynamicdrive.com" for an abundance of different real world examples and applications.
     
    JLDouglas, Jul 25, 2011 IP
  7. Johnletton

    Johnletton Member

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #7
    Yes, i got much of my answer but what about load the javascript file as referenced to minimize the loading of a web page. Do you know about it? i had read it in some blog post when i was searching. thanks for cooperating
     
    Johnletton, Jul 25, 2011 IP