Search code examples
asp.netjavascriptiisvirtual-directory

Why does JavaScript not work on my site under an existing virtual directory?


I deployed my ASP.NET application under an existing virtual directory. The new deployment will have some features using JavaScript. The new features are not working.

If I deploy this build under a new virtual directory, the features using JavaScript are working.

I restarted the IIS Admin service. The problem continues.

What could be going wrong here?


Solution

  • After the deployment if javascript features are not working then it may be beacuse executes the script which already cached. In this case to handle the situation please do the following
    

    Try changing the JavaScript file's src?

    From this:

    To this:

    This method should force your browser to load a new copy of the JS file.