我想在alert()上获得concat结果,该结果存储在变量FavAppnd中,
测试
alert (FavAppnd);//returns object Object
alert (FavAppnd.toString());//returns object Object
alert (JSON.stringify(FavAppnd));//returns {"0":{},"length":1}
但我想在alert()----
的html模式中这样想
由于html标签是动态创建的,因此浏览器上的页面源选项不会在运行时显示html标记。所以要验证我是否需要alert()
。
<tr>
<td>ABC</td>
<td><img src="images/star1.png" onclick="changeStar(this)" width="32" height="32" id=0></td>
</tr>
HTML
<table id="favicon" border="1">
</table>
JS
function favShow()
{
var invocationFav={
adapter:"SQL_ADAPTER_1",
procedure:"procedureFavoriteShow",
parameters:[]
};
var options={
onSuccess:succFavShow,
onFailure:failFavShow
};
WL.Client.invokeProcedure(invocationFav,options);
}
function succFavShow(result)
{
var a=result.invocationResult.resultSet.length;
if(a>0)
{
alert("FavShow success");
var Favlist = $("#favicon");
for(var i=0;i<a;i++)
{
var FavAppnd=$('<tr><td>'+name+'</td>'+'<td>'+'<img src="images/star1.png" onclick="changeStar(this)" width="32" height="32" id='+id+'></td></tr>');
Favlist.append(FavAppnd);
alert (FavAppnd);//returns object Object
alert (FavAppnd.toString());//returns object Object
alert (JSON.stringify(FavAppnd));//returns {"0":{},"length":1}
}
}
else
{
alert("Favorite not available");
}
}
function failFavShow()
{
alert("try again");
}