Right now I have the following links in my code:
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
etc ...
I'd like to make use of the google.com cached copies. I heard google is the best source but please correct me if I am wrong.
Anyway is it possible for me to code my application so it uses code from google if available and locally if not. FYI I am using Microsoft MVC3 and the Msoft cloud servers.
Thanks
No you do not need the internet connection when writing codes in jQuery. Download the jQuery file, keep it on the website folder and then include it on your page. In case if you are putting the jQuery CDN link in your website only then you will need internet connection.
Is it possible to load a single page from an external website? Yes, it's possible, but you'll need 1 line of PHP :) If you only need RSS feeds and you don't mind relying on Google you could use jquery-feeds.
In Google Sites, Google lets you put (some) JavaScript into an HTML Box that you can easily place on a page ( Insert -> HTML Box ). They helpfully explicitly allow jQuery: You can link script tags to jQuery (For example, https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js).
Projects In JavaScript & JQueryYes, you can use multiple versions of jQuery on the same page. To avoid any kind of conflict, use the jQuery.
Sure, check out how they do it in HTML5 boilerplate.
If you take a look at the bottom of the index.html file within the GitHub repo, you'll see the following...
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/X.X.X/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="local/jquery-X.X.X.min.js">\x3C/script>')</script>
NB: In the code snippet above X.X.X should be replaced with the jQuery version number that you're using (e.g. 1.8.2).
jQuery
global object.jQuery
does not exist, the obvious assumption is that we didn't manage to get the code from the CDN, so then we document.write
a script tag to get a copy from a local source instead.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With