日期:2014-05-16  浏览次数:20390 次

关于JQ切换onclick问题
JScript code

var listTable = new Object; 
listTable.toggle = function(obj, act, id,state)
{
    var result = ajax.FactoryUser("js/factory_ajax.ashx?id="+id+"&act="+act+"&transmitstate="+state+"&type=u_fc","post",false);
    
    switch(result)
    {
        case "1": $(obj).attr("class","state0");          
                        break;
        case "0": $(obj).attr("class","state1");
                        break;
    }
}



<a href="javascript:void(0)" onclick='listTable.toggle(this,"edit","1","1")' class="state0">状态</a>

我想动态改变 listTable.toggle(this,"edit","1","1") 这个里面的参数。多谢

------解决方案--------------------
把它改成变量被。。
------解决方案--------------------
字符串会是变量吗?从哪传的在哪改