views:

40

answers:

1

We have moved a lot of images and javascript file that was inside class to external Javascript file. In development (Debug inside Visual Studio), everything look nice, all images show, all javascript works and all CSS display perfectly. When we do a package and install with IIS ina virtual directory everything that is pointed by the JavaScript doesn't work.

Question : Since we cannot use the tilde (~) in javascript or in CSS what is the way to display those resources?

Edit 1

The problem is the website is installed with a Virtual Directory and if we have in the JavaScript file a popup that has a hardcoded path in the JavaScript the code try to display : "http://localhost/NameSpace/Directory/File.html" instead of "http://localhost/VIRTUALDIRECTORY/NameSpace/Directory/File.html". Is there a configuration with IIS or inside the code I need to add something like a parameter to pass the path everytime?

In the javascript in dev it work to have something like :

var popWindowPath = '/ProgressFile/Simple/ProgressSlow.htm';
+1  A: 

Images for css are, I believe, displayed relative to the css file so that shouldn't be an issue (use relative rather than absolute links).

For the js, either have the ability to pass a base link in as an argument or make .js files parsed as .net pages and include code on those pages.

Zarigani
Images are in the CSS and everything is relative path. For the Javascript, your idea to pass a base link is clever. I thought about it but before going this way thought that it would be interesting to know what's it the best practice.
Daok