您现在的位置是:首页 > 电脑技术查询 > web开发

一个简单JS

编辑:chaxungu时间:2022-10-02 23:15:18分类:web开发

一个简单JS求助!
JScript codedocument.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+"\" \/>");