JS 问题 下面的代码能不能请高手们帮我解释一下啊?

1.
<script language="javascript" type="text/javascript">
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
theform = document.frmCart;
}
else {
theform = document.forms["frmCart"];
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}

</script>

2.
<a id="HeadStyle1_lkbStatus" href="javascript:__doPostBack('HeadStyle1$lkbStatus','')" style="font-size:12px;">退出</a>
特别是符号"$"

每句都解释清楚啊,谢谢啊??高手 每一句的意思都要解释清楚啊,不要把两句或者更多的概括来解释啊

//补充你一个正确的代码,自己测试一下,代码如下:

<script language="javascript">
<!--
function __doPostBack_Ex(eventTarget, eventArgument)
{
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
theform = document.forms[0];
}
else {
theform = document.forms[0];
}

if(!theform.__EVENTTARGET)
{
theform.appendChild(document.createElement("<input type='hidden' name='__EVENTTARGET'>"));
}

if(!theform.__EVENTARGUMENT)
{
theform.appendChild(document.createElement("<input type='hidden' name='__EVENTARGUMENT'>"));
}

theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
if ((typeof(theform.onsubmit) == "function"))
{
if(theform.onsubmit()!=false)
{
theform.submit();
}
}
else
{
theform.submit();
}

function __doPostBack(eventTarget, eventArgument)
{
__doPostBack_Ex(eventTarget, eventArgument);
}

}
// -->
</script>
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答