开发者

Passing a Parameter to the function

开发者 https://www.devze.com 2023-03-10 08:57 出处:网络
I am trying to pass the parameter name to the function, but I am unable to pass function interfaceName(x,y,z){

I am trying to pass the parameter name to the function, but I am unable to pass

function interfaceName(x,y,z){      
return "<div class='iconRow2 linkrow'&开发者_StackOverflow社区gt;<a href='javascript:mcrloadgraphdata('+x+'')'>"+x+"</a></div>";   
}

function mcrloadgraphdata(interfaceName)
{       
    alert(interfaceName);
}


I didnt follow your question too well. But I guessed what you might be asking.

There appears to be a mistake with Single quote and double quotes in your statement Try this

    function interfaceName(x,y,z){
         return "<div class='iconRow2 linkrow'><a href=\"javascript:mcrloadgraphdata('"+x+"')\">"+x+"</a></div>";
    }

    function mcrloadgraphdata(interfaceName) {
        alert(interfaceName);
    }


replace your return statement by this :

return "<div class='iconRow2 linkrow'><a href='javascript:mcrloadgraphdata('"+x+"')'>" + x + "</a></div>";
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号