获取 JavaScript 运行时错误:irrationalPath,这是什么意思? [英] Getting JavaScript runtime error: irrationalPath, what does it mean?

查看:26
本文介绍了获取 JavaScript 运行时错误:irrationalPath,这是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 MasterPage 中,我使用以下脚本

In my MasterPage i'm using the following script

<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3"></script>

在我的应用程序中,我拥有 JavaScript 代码的宁静

And in my application, i have this peace of JavaScript code

document.getElementById(menu_number).src = "<%=HttpContext.Current.Request.ApplicationPath%>/UI/Common/Images/down-arrow.gif";

我下面还有 Application_AcquireRequestState 方法

I also have the Application_AcquireRequestState method below

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 中引发以下错误.

When document.getElementById(menu_number).src = "<%=HttpContext.Current.Request.ApplicationPath%>/UI/Common/Images/down-arrow.gif"; is being executed, it throws the below error in IE 11.

JavaScript 运行时错误:irrationalPath

JavaScript runtime error: irrationalPath

它还在方法Application_AcquireRequestState"中引发异常,但我无法获取异常详细信息.当我在方法Application_AcquireRequestState"中放入 try -- catch 时,返回的异常内部消息是

It also throws an exception in method "Application_AcquireRequestState" but i'm not able to get the exception details. When i put a try -- catch in the method "Application_AcquireRequestState", the exception inner message being returned is

无法计算表达式,因为代码已优化或本机框架位于调用堆栈顶部.

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

我发现很难调试这个.上面这行 JavaScript 在初始页面加载时成功执行,但是当我在页面加载后单击特定超链接时会引发该错误.

I'm finding it hard to debug this. The above line of JavaScript executes successfully on the initial page load but throws that error when i'm clicking particular hyperlinks after page load.

JavaScript 错误:irrationalPath 最可能的原因是什么?以及无法评估表达式,因为代码已优化或本机框架位于调用堆栈顶部."实际上是什么意思?

What could be the most likely causes of JavaScript error: irrationalPath? And what does "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack." actually mean?

有关如何有效解决此问题的任何建议?

Any suggestions on how i can effectively troubleshot this?

我已经看到观察到在 http 的 javascript 文件中定义了 IrrationalPath 异常://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3

推荐答案

您是否尝试在您的 js 代码中将 HttpContext.Current.Request.ApplicationPath 设为 String(用两个引号分隔).

Have you tried to make the HttpContext.Current.Request.ApplicationPath as String in your js code (delimited with two quotes).

js 代码变成:

document.getElementById(menu_number).src = <%="'"+HttpContext.Current.Request.ApplicationPath+"'"%>+"/UI/Common/Images/down-arrow.gif";

这篇关于获取 JavaScript 运行时错误:irrationalPath,这是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆