简体   繁体   English

将Web应用程序部署到IIS之后的JavaScript

[英]JavaScript after deploying web application to IIS

I develop a web application which uses a lot of JavaScript. 我开发了一个使用很多JavaScript的Web应用程序。 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 ie 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? 部署到IIS的远程计算机后出现问题-该页面可以运行,但是我编写的整个验证无法运行-我已经在FF,IE6和IE7下进行了检查。是否有任何IIS属性可以设置以使其运行?

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: validate()函数在此处调用:

<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: 并通过控件从.js文件动态加载validateTrees()函数:

<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. 似乎在部署之后,浏览器无法找到validateTrees()函数。

IIS shouldn't affect your JS in anyway (as long as the JS files are present and accessed properly). IIS无论如何都不会影响您的JS(只要JS文件存在并且可以正确访问)。

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. 您能否发布一些示例代码,说明您所拥有的(最好是简单的测试用例),您期望它做什么,它没有做什么,以及遇到的错误(如果有)。

IIS has nothing to do with this. IIS与此无关。

Your javascript files are downloaded by the browser on the client machine and runs there, not on the server. 您的javascript文件是通过客户端计算机上的浏览器下载的,并在客户端计算机上运行,​​而不是在服务器上运行。

Make sure you published your files correct. 确保您正确发布了文件。

Javascript typically runs on the client not the server. Javascript通常在客户端而非服务器上运行。 What makes you think this has anything to do with IIS? 是什么让您认为这与IIS有关?

Use a tool such as fiddler to confirm the browser is receiving all the content your expect. 使用诸如Fiddler之类的工具来确认浏览器正在收到您期望的所有内容。

好的,这很愚蠢,部署后我没有更新脚本的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 IIS 上部署 web 应用程序 5 - Deploying a web application on the IIS 5 在IIS上部署ASP.NET Web应用程序后对** web.config **进行的更改 - Changes to be made to **web.config** after deploying ASP.NET Web Application on IIS 将我的asp.net MVC Web应用程序部署到IIS7后,无法将其连接到SQL Server - Unable to connect my asp.net mvc web application to the sql server after deploying it to IIS7 部署 asp.net web 应用程序 IIS7 后链接断开 - Broken link after deploying asp.net web application IIS7 将Web应用程序部署到IIS时,图像未在转发器内部加载 - Images are not loading inside repeater when deploying web application to IIS 在 IIS 6 上使用路由部署 ASP.NET 4 Web 窗体应用程序 - Deploying ASP.NET 4 Web Forms Application Using Routing on IIS 6 将ASP.NET 4 Web应用程序部署到IIS6服务器后,工作进程回收导致其大部分时间停止工作 - After Deploying ASP.NET 4 web application to IIS6 server, worker process recycles cause it to stop working most of the time 部署后Web应用程序中的解析器错误 - Parser Error in Web Application after deploying 在IIS中部署后,Web API访问被拒绝错误 - Web API Access denied error after Deploying in IIS 在IIS 8上部署后,Asp.net应用程序给出错误 - Asp.net application giving error after deploying on IIS 8
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM