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>";
精彩评论