开发者

Passing a Parameter to the function

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜