Google hosted .js and .css?

Google hosted .js and .css?

gavingavin Posts: 22Questions: 0Answers: 0
edited August 2009 in General
I use `ajax.googleapis.com/ajax/libs` in my html head's to include jquery and jqueryui js files.

Is there a similar method for including datatable's js file?

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    Hi gavin,

    At the moment there isn't any hosting provided of the DataTables scripts - although it's a good idea for moving forward - added to my to do list :-).

    Out of interest, is this for speed issues, bandwidth or ease of ease of maintenance. Speed wise I'm guessing it would be best just to host all your Javascript files, concatenate them together into a single file and server that up.

    Regards,
    Allan
  • gavingavin Posts: 22Questions: 0Answers: 0
    For performance and simplicity.

    I paste this into my header currently for jquery:
    [code]

    <!-- jquery/jqueryui -->



    <!-- /jquery/jqueryui -->


    [/code]

    Here is an interesting article about hosted js files:
    http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/
  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    Hi gavin,

    Thanks for the link - very interesting. A good set of reasons there. I try to follow similar ideas for larger sites by contacting all my scripts into a single file (this site for example - although not this forum...) and for "big" sites I would have a domain alias to get around the concurrency issues. Depends on the amount of control required :-) - a million ways to solve every problem - love it! :-)

    Regards,
    Allan
  • gavingavin Posts: 22Questions: 0Answers: 0
    oh also, you can make your own js repository on Google code. If you put your js and css files onto a Google Code project, then anyone can point to that instead of having to download the files and add to their webhost. Its nice if we dont want to have to download Datatables js for every revision, we can point to the generic Datatables js file on Google code instead.

    Here is more info, scroll down near the end:
    http://codefusionlab.blogspot.com/2009/07/offloading-all-js-files-to-google.html
  • PatriciaPatricia Posts: 9Questions: 0Answers: 0
    bumping the idea of the google repository

    I like that Jquery is there and any other site that linked would already be available when they load mine. As we want DataTables to be popular.... the more who use it linked the faster it's gonna be. It's still the best I've seen out there.
  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    Hi Patricia,

    DataTables and all of it's various components are available on Github - https://github.com/DataTables/ (they weren't at the time of the original thread). Github I recall offer CDN options of their own, which I must look into and document! A library needs to be super popular before getting on the proper Google CDN I think :-).

    Regards,
    Allan
This discussion has been closed.