Can any one tell me please how to use js file in Orchard CMS? I added it to Layout.cshtml page as
Script.include(\"jquery.js\")
.
If you have the Orchard.jQuery module installed and enabled, then at the top of your view use:
Script.Require("jQuery")
Have a look at the ResourceManifest class in the Orchard.jQuery project (should be somewhere in your Orchard solution file), there you can see all the different jQuery modules you can include using this syntax (e.g. jQueryUI_Core
, jQueryUI_Tabs
, etc)
E.g.
manifest.DefineScript("jQueryUI").SetUrl("jquery-ui.min.js", "jquery-ui.js").SetVersion("1.9.2").SetDependencies("jQuery")
.SetCdn("//ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.min.js", "//ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.js", true);