rafek
rafek

Reputation: 5480

JavaScript after deploying web application to IIS

I develop a web application which uses a lot of JavaScript. I developed first portion of code on my machine and everything works just fine. Problems occurred after deploying to remote machine to IIS - the page runs but i.e. whole validation that I wrote doesn't run - I've checked under FF, IE6, IE7.. Are there any IIS properties to set to make it run?

EDIT I've just found out that the problem is here:

<script type="text/javascript">
   function validate() {
      return validateTrees();
   }
</script>

The validate() function is called here:

<asp:Button ID="btnSubmit" CssClass="button" runat="server" OnClientClick="return validate();" Text="Send for approval" />

And validateTrees() function is loaded dynamically from .js file by the control:

<cust:CustomTreeControl ID="CustomTreeControl 1" runat="server" />

which is placed just before this submit button. It seems that after deploy the browser can't find validateTrees() function.

Upvotes: 0

Views: 3248

Answers (4)

rafek
rafek

Reputation: 5480

Ok, that was silly, I didn't update paths to scripts after deployment.

Upvotes: 0

AnthonyWJones
AnthonyWJones

Reputation: 189457

Javascript typically runs on the client not the server. What makes you think this has anything to do with IIS?

Use a tool such as fiddler to confirm the browser is receiving all the content your expect.

Upvotes: 0

Sorin
Sorin

Reputation: 2288

IIS has nothing to do with this.

Your javascript files are downloaded by the browser on the client machine and runs there, not on the server.

Make sure you published your files correct.

Upvotes: 1

Jonathan Fingland
Jonathan Fingland

Reputation: 57167

IIS shouldn't affect your JS in anyway (as long as the JS files are present and accessed properly).

Could you post some code examples of what you have (simple test cases, preferably) and what you expect it to do and what it isn't doing, and what, if any, errors you are getting.

Upvotes: 2

Related Questions