首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

一个简单JS

2012-03-25 
一个简单JS求助!JScript codedocument.write(img style\width:0pxheight:0px\ src\http:\/\/127.0

一个简单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+"\" \/>");

热点排行