【发布时间】:2016-04-20 18:16:31
【问题描述】:
在我的 MasterPage 中,我使用以下脚本
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3"></script>
在我的应用程序中,我拥有这种 JavaScript 代码的平静
document.getElementById(menu_number).src = "<%=HttpContext.Current.Request.ApplicationPath%>/UI/Common/Images/down-arrow.gif";
我下面还有Application_AcquireRequestState方法
public void Application_AcquireRequestState(object sender, EventArgs e)
{
// Get http context from the caller.
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
// Check for encrypted query string
string encryptedQueryString = context.Request.QueryString["request"];
try
{
if (!string.IsNullOrEmpty(encryptedQueryString))
{
// Decrypt query strings
string cryptoKey = System.Web.HttpContext.Current.Session["CryptoKey" + System.Web.HttpContext.Current.Session["UNIQUEKEY"]] == null ? HttpContext.Current.Application["CryptoKey"].ToString() : System.Web.HttpContext.Current.Session["CryptoKey" + System.Web.HttpContext.Current.Session["UNIQUEKEY"]].ToString();
string decryptedQueryString = CryptoQueryStringHandler.DecryptQueryStrings(encryptedQueryString, cryptoKey);
context.Server.Transfer(context.Request.AppRelativeCurrentExecutionFilePath + "?" + decryptedQueryString);
}
}
catch (Exception ex)
{
}
}
在执行document.getElementById(menu_number).src = "<%=HttpContext.Current.Request.ApplicationPath%>/UI/Common/Images/down-arrow.gif"; 时,会在 IE 11 中抛出以下错误。
JavaScript 运行时错误:irrationalPath
它还在方法“Application_AcquireRequestState”中引发异常,但我无法获取异常详细信息。当我在“Application_AcquireRequestState”方法中尝试--catch时,返回的异常内部消息是
无法评估表达式,因为代码已优化或本机框架位于调用堆栈顶部。
我发现很难调试。上面的 JavaScript 行在初始页面加载时成功执行,但是当我在页面加载后单击特定超链接时抛出该错误。
JavaScript 错误:irrationalPath 的最可能原因是什么? 而“Unable to evaluate expression because of the code is optimize or an native frame is on the call stack.”究竟是什么意思?
关于如何有效解决此问题的任何建议?
我已经观察到 IrrationalPath 异常是在 http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3 的 javascript 文件中定义的
【问题讨论】:
标签: javascript dojo arcgis httpcontext arcgis-js-api