如何使用javascript请求使用属性?

时间:2016-01-04 17:43:52

标签: javascript jsp

为什么警报框不起作用?

dis.dis

1 个答案:

答案 0 :(得分:1)

我猜这个函数返回一个字符串。试试这个:

alert("<%=player.getTempId()%>");

因为如果返回没有引号的字符串,您将获得要呈现此页面的页面:

alert(aString) //and then you'll get an error that aString is not defined. 

通过添加“”,页面将呈现如下:

alert("aString") //and will work