0

I see here: Where do you include the jQuery library from? Google JSAPI? CDN? that this is a good way to include jQuery from a CDN (Google's):

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>

As jQuery 2 was just released, I am planning on using:

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

...and the latest jQueryUI, too:

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>

Note: These snippets, which are identical to the "canonical answer" on Stack Overflow linked to above, are from google's jQuery CDN page: https://developers.google.com/speed/libraries/devguide#jquery-ui

Now my question is: Where in a WebMatrix project should the references to the CDN go? In Web.Config? _AppStart.cshtml? _SiteLayout.cshtml? Or...???

Community
  • 1
  • 1
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

1 Answers1

0

The _SiteLayout.cshtml would be the place:

. . .
<script src="~/Scripts/jquery-2.0.0.min.js"></script>
<!-- May want to replace the above before deploying with:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
..and similar for jquery-ui -->
<script src="~/Scripts/jquery-ui-1.9.2.js"></script>
. . .

Of course, need to download jquery-2.0.0.min.js from http://code.jquery.com/jquery-2.0.0.min.js and place it in the project's Scripts folder.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862