Results 1 to 6 of 6

Thread: Where does JQuery library reside?

  1. #1
    Join Date
    Dec 2013

    Where does JQuery library reside?

    I have admit that I am complete noob on all of this. I am trying to learn HTML5, Javascript, CSS, JQuery, etc.

    Does the JQuery library reside in the browser such that it executes the underlying JS from the library? Or is the JQ library code included in my server-side code when I publish? It sure makes more sense to me that it be only on the browser side to reduce the bandwidth.

    Sorry for the (probably ) stupid question but I just cannot seem to find an answer with all my searches.

  2. #2
    Join Date
    Oct 2013
    JQuery is client-side. That means that it's loaded with your HTML and other assets your page requires. It runs in the browser and not on the server.

    Bandwidth is another question entirely. Depending on which JQuery library you are calling it could be anywhere from 80 to 100+ kb of bandwidth. One of the advantages (in my mind) of calling a library from a central repository such as Google rather than hosting it on your site is that a user has probably been to another site using the same library. Therefore there's next to no bandwidth used since it gets loaded from their browser cache. The bandwidth used is whatever plugin script you have that uses the library.

    It's still another HTTP request no matter what. If the library is in cache it will load from there but the server still has to handle the request and send a response (304). If not in cache the file/library gets sent.

    Hope I didn't confuse you

  3. #3
    Join Date
    Dec 2013
    Thank you for the response Kevin! So wait...you mean the browser(client), when it parses a JQ request, may have to go out and ask an external server(JQuery.com0 to figure out the JQ? I was thinking the browser machine might have a local copy of the JQ library and just access it from the hard drive? No, you make complete sense. Just trying to understand what is going on. This is stuff I do not see when JQuery is explained. Thanks!

  4. #4
    Join Date
    Oct 2013
    If you are calling a JQuery library that a user does not have already in their browser cache it does download it from whereever your page calls it from. The browser does not come with JQuery preinstalled, but it will execute the code once downloaded and requested. JQuery is really a library of JavaScript that can be leveraged via plugins. So it acts somewhat like JavaScript in that it has to be called, loaded and executed.

    That being stated, having the JQuery file in the browser cache is almost like having it "built in" to the browser in that it doesn't have to be downloaded again. That's the reason for calling a library from a central repository like Google or JQuery.com. In all likelihood, your user has been to another site using the same library from either Google or JQuery and the file already is "built in" to their browser and doesn't have to be downloaded again. However if you host that library on your site the browser thinks it's a different library, even if it has the same filename, and downloads it again.

    A real world example: I have a photo gallery script on a couple of sites that uses HTML5, CSS3, and JQuery to present thumbnails and full-size photos in a really slick display. I call the JQuery library like this:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
    But if I was hosting it on my site the code would look something like:
    <script type="text/javascript" src="/assets/jquery.min.js"></script>
    To a browser those are 2 different files, even if the contained code is exactly the same. The link to googleapis would probably return a 304 to a browser and the file would load from cache. The "local" link would download the library from your site the first time a user hits a page needing it.

    More confusion, I suppose. Sorry for being so wordy...

  5. #5
    Join Date
    Dec 2013
    Interesting. And it makes complete sense, Kevin. Thank you for taking part of your Christmas Day to 'edumacate' me!

  6. #6
    Join Date
    Oct 2013
    I don't know how much of an "edumacation" was provided, but for what little there was you're welcome!

    Merry Christmas -- what's left of it!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.15445 seconds
  • Memory Usage 2,888KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (72):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates