Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mixing bundles and regular script?
Message
 
 
À
27/10/2012 04:12:35
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01555909
Message ID:
01555935
Vues:
29
>>In other words, this compiles, but I am not sure if this is correct usage:
>>
>>
>> bundles.Add(new ScriptBundle("~/bundles/jquery.dataTables").Include("http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js","http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"));
>>
>>
>>UPDATE. Working through this blog post now http://www.tomdupont.net/2012/03/configuring-bundles-in-mvc-4.html
>>So far I managed to break the already working page, but hopefully will succeed at the end.
>>Thanks in advance.
>
>I think you can use BundleCollection.UseCdn which also allows for fallback if the CDN is not available.
>See 'Using a CDN' here: http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification

Is there a way to specify directory for all jquery, instead of providing cdn path for each individual jquery file?

Say, in the bundles.config I have
<jsBundles>
    <add bundlePath="~/js/shared" minify ="true">
      <directories>
        <add directoryPath="~/scripts/jQuery/" searchPattern="*.js"></add>
        <add directoryPath="~/scripts/" searchPattern="*.js"></add>
      </directories>
      <!--
      <files>
        <add filePath="~/scripts/jscript1.js"></add>
        <add filePath="~/scripts/jscript2.js"></add>
      </files>
      -->
    </add>
  </jsBundles>
and I want to be able to add cdnPath for al jquery files.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform