获取JavaScript运行时错误:非理性路径,这意味着什么?
在我的主页中,我使用以下脚本获取JavaScript运行时错误:非理性路径,这意味着什么?,javascript,dojo,arcgis,httpcontext,arcgis-js-api,Javascript,Dojo,Arcgis,Httpcontext,Arcgis Js Api,在我的主页中,我使用以下脚本 <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3"></script> 当document.getElementById(菜单号).src=“/UI/Common/Images/down arrow.gif”正在执行,它在IE 11中抛出以下错误 JavaScript运行时错误:非理性路径 它还在方法“Appli
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3"></script>
当document.getElementById(菜单号).src=“/UI/Common/Images/down arrow.gif”代码>正在执行,它在IE 11中抛出以下错误
JavaScript运行时错误:非理性路径
它还在方法“Application\u acquisitionequeststate”中抛出异常,但我无法获取异常详细信息。当我在方法“Application\u AcquisiteRequestState”中放入try--catch时,返回的异常内部消息是
无法计算表达式,因为代码已优化或本机帧位于调用堆栈顶部
我发现很难调试这个。上面一行JavaScript在初始页面加载时成功执行,但在页面加载后单击特定超链接时抛出该错误
JavaScript错误最可能的原因是什么:非理性路径?
而“由于代码已优化或本机框架位于调用堆栈顶部而无法对表达式求值”实际上意味着什么
关于如何有效地解决这个问题,有什么建议吗
我已经注意到,非理性路径异常是在javascript文件中定义的,位于,这是javascript错误最可能的原因:非理性路径错误可能与您在问题中发布的任何代码无关。这是一个dojo错误,当dojo加载程序出现问题时通常会看到。它可能与dojoConfig中的路径或包设置有关。有关更多信息,请参阅
您得到的另一个错误是.NET错误。如果没有看到更多的代码,我无法确定,但这是一个很好的开始,可以排除错误,或者您是否尝试将HttpContext.Current.Request.ApplicationPath
作为js代码中的字符串(用两个引号分隔)
js代码变成:
document.getElementById(menu_number).src = <%="'"+HttpContext.Current.Request.ApplicationPath+"'"%>+"/UI/Common/Images/down-arrow.gif";
document.getElementById(菜单号).src=+“/UI/Common/Images/down arrow.gif”;
我已经尝试了服务器。执行方法,结果不变。
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";