Widget that loading css but not scripts

Topics: Writing modules
Aug 30, 2011 at 8:57 PM

I have a widget that has a view that has this in it:

 

@{
	Script.Require("jQuery");
    Script.Include("jquery.fancybox-1.3.4.pack.js");
    Script.Include("jquery.pwi-min.js");
    Style.Include("jquery.fancybox-1.3.4.css");
    Style.Include("pwi.css");
}

When i show this widget i got the both .css files to load in but the script files, either jquery its self or the plugins is not loading in the code....

Someone has idea?

Using Orchard 1.2.41 and has another installation of orchard with another widget that i have copy the same structure from so i really think its should work but dont...

 

Coordinator
Aug 30, 2011 at 8:58 PM

What do you see in Firebug's network tab, and how does it compare to the physical paths for these files?

Coordinator
Aug 30, 2011 at 8:59 PM

Also, are you sure you have the right web.config in the folder where those files are?

Aug 30, 2011 at 9:04 PM

The CSS files are in the Styles folder and the script files in the Scripts folder and i have tried a web.config from a working installation with another widget and its the same.

I right now testing in Chrome but going to install Firefox and Firebug, but have not done it after a reinstallation of windows.

What i see in the Elements tab in chrome development tool is that the css file tags are in the head tag but not the script tags, so somehow they dont including the tags either.

Coordinator
Aug 30, 2011 at 9:09 PM

The scripts are at the bottom of the html by default. If you want to force them in the head, then write Script.Require(...).AtHead()

Aug 30, 2011 at 9:11 PM

Thanks .AtHead() was what i missed!