日期:2014-05-16  浏览次数:20334 次

一个简单JS求助!
JScript code
document.write("<img style=\"width:0px;height:0px\" src=\"http:\/\/127.0.0.1\/51la.asp?

id='+window.location.search+'\" \/>");


window.location.search为什么没获取到值?怎么写能获取到?

------解决方案--------------------
document.write("<img style=\"width:0px;height:0px\" src=\"http:\/\/127.0.0.1\/51la.asp?id='"+window.location.search+"'\" \/>");
------解决方案--------------------
探讨

好像不要单引号。因为你最外面是双引号,所以+号前后也要是双引号。
document.write("<img style=\"width:0px;height:0px\" src=\"http:\/\/127.0.0.1\/51la.asp?id="+window.location.search+"\" \/>");