5

I have diffrent scripts online in a url:

externalurl/inte/common/js/script1.js

externalurl/inte/common/js/script2.js

externalurl/inte//common/js/script3.js

externalurl/inte//common/js/script4.js

externalurl/inte//common/js/script15.js

How can I create a javascript bundle for external javascript not in my solution?

    bundles.Add(new ScriptBundle("~/bundles/inte").Include(
            "http://url/inte/common/js/script1.js",
            "http://url/inte/common/js/script2.js",
            "http://url/inte/common/js/script2.js));

1 Answer 1

2

If you use CDN jQuery you should enable CDN support bundles.UseCdn = true;

public static void RegisterBundles(BundleCollection bundles)
{
    bundles.UseCdn = true;   //enable CDN support

    //add link to jquery on the CDN
    var jqueryCdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js";

    bundles.Add(new ScriptBundle("~/bundles/jquery",
                jqueryCdnPath).Include(
                "~/Scripts/jquery-{version}.js"));
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.