代码:111.js
document.write("<script language='javascript' src='http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=222.5.142.25'></script>");
document.write("<script>var gj=remote_ip_info.country;</script>")
var Url,kk,cHeight,cWidth,cReferrer,cPage,gj;
Url="http://127.0.0.1:82/tj/cs_tjcs.asp";
kk="123"
//gj=remote_ip_info.country;
cHeight = screen.height;
document.write("<script language=javascript src="+Url+"?kp="+kk+"&gj="+gj+"></script>");
此代码中,直接通过var gj=...无法获取值,通过document.write("var gj=remote_ip_info.country;")可以获取值,但是在最后一行代码调用时确无法取到值&gj="+gj+"。
通过document.write("var gj=remote_ip_info.country;")获取值后,可以通过document.write("alert(gj);")正确显示。
要求在最后一行代码中取到值,在线等大侠指教,谢谢!