Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to reference external scripts.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Welborn  
View profile  
 More options Dec 29 2011, 4:36 pm
From: John Welborn <jwwel...@gmail.com>
Date: Thu, 29 Dec 2011 13:36:14 -0800 (PST)
Local: Thurs, Dec 29 2011 4:36 pm
Subject: How to reference external scripts.
How do I define a reference to an external script?

For example, if I'm using jquery as an external reference on a cdn,
how do I reference that script for a plugin?

Sort of related to this and a previous question... do I need to edit
every plugin I download to add a reference to jquery?  This seems
wrong.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Davey  
View profile  
 More options Jan 3 2012, 8:58 am
From: Andrew Davey <and...@equin.co.uk>
Date: Tue, 3 Jan 2012 13:58:56 +0000
Local: Tues, Jan 3 2012 8:58 am
Subject: Re: How to reference external scripts.

Changing a third-party script is something to avoid if possible! There are
other ways to define a bundle's references.

Option 1) If using a bundle.txt file, try adding a [references] section:

third-party-widget.js
some-plugin.js

[references]
~/jquery

This assumes that "jquery" is an alias for the CDN URL. i.e.
bundles.AddUrlWithAlias("http://cdn.com/jquery.js", "jquery");

(You can just put the URL into the bundle.txt, but that'll make updating
versions more work later.)
---

Option 2) Call Bundle.AddReference

In CassetteConfiguration, try this:
bundles.Add<ScriptBundle>("path", b => b.AddReference("jquery"));

Or after the Add* calls, you can get to the bundle by its path:
bundles["path"].AddReference("jquery");
---

If you do own the script file, then reference either the jquery CDN URL, or
the alias:
/// <reference path="~/jquery"/>

I hope that helps. Please let me know if you have more questions.

Thanks,
Andrew

On 29 December 2011 21:36, John Welborn <jwwel...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Welborn  
View profile  
 More options Jan 4 2012, 11:40 am
From: John Welborn <jwwel...@gmail.com>
Date: Wed, 4 Jan 2012 08:40:37 -0800 (PST)
Local: Wed, Jan 4 2012 11:40 am
Subject: Re: How to reference external scripts.
Awesome!  That's exactly what I needed to know!

On Jan 3, 7:58 am, Andrew Davey <and...@equin.co.uk> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »