gpt4 book ai didi

javascript - 系统参数计数异常 : Parameter count mismatch

转载 作者:可可西里 更新时间:2023-11-01 02:07:19 27 4
gpt4 key购买 nike

我在 firefoxgoogle chrome 中遇到以下问题:

Sys.ParameterCountException: Parameter count mismatch. 

我调用以下 javascript 方法 onclick :

<script type="text/javascript">
var confirmSubmited = false;
function SubmitWithLog(par_name, par_address, frm) {

jQuery.ajax({
url: "/LogAction.ashx?par_name=" + par_name + "&par_address=" + par_address,
type: "GET",
timeout: 3000,
async: true, // you can try and async:false - maybe is better for you
data: action = 4, // here you send the log informations
cache: false,
success: function(html) {
jQuery(frm).submit();
},
error: function(responseText, textStatus, XMLHttpRequest) {
jQuery(frm).submit();
}
});

return false;
}
</script>

来自 Firebug 的链接将呈现如下:

<a href="#" onclick="SubmitWithLog('%d8%b7%d9%84%d8%a8+%d8%a5%d9%84%d8%aa%d9%85%d8%a7%d8%b3+‌​%d9%84%d9%84%d9%85%d9%88%d8%a7%d8%b1%d8%af+%d8%a7%d9%84%d8%a8%d8%b4%d8%b1%d9%8a%d‌​8%a9','...../RequestList.aspx','#ctl43');return false;">GO </a>

根据以下链接:

Error: Sys.ParameterCountException: Parameter count mismatch.

我设置了 ScriptMode = "release"

但是我得到另一个错误

this._toFormattedString is not a function

IE不存在这个问题。


编辑:

public class LogAction : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{


public void ProcessRequest(HttpContext con)
{
// log here what you wish
string[] statistics = TrackUser();
string a = HttpUtility.UrlDecode(con.Request.Params["Par_name"].ToString());
string b = con.Request.Params["Par_address"].ToString();

TraceActivity(a, b, statistics[0], statistics[1], statistics[2]);
// end up with no content
con.Response.TrySkipIisCustomErrors = true;
con.Response.Status = "204 No Content";
con.Response.StatusCode = 204;
}

//-------------------------------------------
}

最佳答案

当您使用错误数量的参数调用 ajax API 的公共(public)方法时,就会发生这种情况。例如,尝试 Boolean.parse("true", "what?")。它只需要 1 个参数,您传入 2 个或发送空值。

您的提交链接 ...../RequestList.aspx 看起来也不是正确的地址。因此请确保您没有传递空参数或错误参数。

关于javascript - 系统参数计数异常 : Parameter count mismatch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11032413/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com