TRY:<img id="img1" src="http://localhost/ggao/tupian/1.gif" border="0"><script language="javascript">
var a = "http://localhost/ggao/tupian/1.gif";
img1.src = a;
</script>
var a = "http://localhost/ggao/tupian/1.gif";
img1.src = a;
</script>
解决方案 »
- 这段代码说是实现了一个复制数据的函数,但是看不懂是什么意思,求大虾指点
- js中怎样给字符串中每个字后加一个换行符,使字符串在网页上换行显示?
- 请教个java语法错误
- 请教ie的一个诡异问题
- showModalDialog 弹出的页面 怎么实现打印功能?
- 求用JavaScript+xml制作的树型菜单
- 请问,在客户端好不好判断上传的文件是否存在?
- 哪位高手能告诉我这个问题怎么解决??
- 关于将\u4E00-\u9FA5转换成汉字的方法和将"汉字"转换成\u4E00-\u9FA5 又一个100分
- JS activeXObject 问题
- 请问能否在页面中往.js文件里传值 比如像<script src=abc.js?id=1234234&name=meizz></script>
- 通过javascript 连接,SQL2000 数据库。查询数据,头10条数据,填充到 数组里,然后通过数组调用显示!。有问题
<a href=http://www.flash8.net target=_blank><img id="img1" img1.src=aabb border=0></a>现在还是没有显示!这是怎么回事。
var aabb = "http://localhost/ggao/tupian/1.gif";
document.write("<a href=http://www.flash8.net target=_blank><img src="+aabb+" border=0></a>");
</script>
var aabb = "http://localhost/ggao/tupian/1.gif";
document.write("<a href=http://www.flash8.net target=_blank><img src="+aabb+" border=0></a>");只显示单个图片可以正常显示,但我加上格式和样式,就不行了,我给怎么写下面的语句?
但我用
var aabb = "http://localhost/ggao/tupian/1.gif";
theFloaters.addItem('followDiv2','document.body.clientWidth-106',111,'<br>document.write("<a href=http://www.flash8.net target=_blank><img src="+aabb+" border=0></a>")';
提示我有错误显示不了,我下面的语句该怎么写,求高人指教,谢谢大家!!~
var a="http://localhost/ggao/tupian/1.gif";
<img src=&{a}; border=0>
即可
你這什麼意思呀??
先分清腳本跟ASP代碼吧。
我应该怎么写!才能正确显示!
<html>
<body>
<script language="javascript">
var delta=0.15
var collection;
function floaters() {
this.items = [];
this.addItem = function(id,x,y,content)
{
document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute; width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
var newItem = {};
newItem.object = document.getElementById(id);
newItem.x = x;
newItem.y = y;
this.items[this.items.length] = newItem;
}
this.play = function()
{
collection = this.items
setInterval('play()',10);
}
}
function play()
{
if(screen.width<=800)
{
for(var i=0;i<collection.length;i++)
{
collection[i].object.style.display = 'none';
}
return;
}
for(var i=0;i<collection.length;i++)
{
var followObj = collection[i].object;
var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);
if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {
var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
followObj.style.left=followObj.offsetLeft+dx;
}
if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {
var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;
dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
followObj.style.top=followObj.offsetTop+dy;
}
followObj.style.display = '';
}
}
var theFloaters = new floaters();
//上面是对,浮动图片的控制//这样单独可以显示,但不能在 theFloaters.addItem 里显示!?
var aabb = "http://localhost/ggao/tupian/1.gif";
document.write("<a href=http://www.flash8.net target=_blank><img src="+aabb+" border=0></a>");//我不用变量直接,赋给src地址就可以显示!但用了变量就不行了,应该怎么写!?
theFloaters.addItem('followDiv1','document.body.clientWidth-106',80,'<br><a href=http://localhost/ggao/js.aspx?id=1 target=_blank><img src=http://localhost/ggao/tupian/1.gif border=0></a>');
//我改的这句,就显示不了,请问错在哪,应该怎样改写下面这段代码!
theFloaters.addItem('followDiv2','document.body.clientWidth-106',111,'<br><a href=http://www.flash8.net target=_blank> <img src=&{aabb} border=0></a>');
//我如何才能用aabb变量 在theFloaters.addItem里正常显示? theFloaters.addItem('followDiv3','document.body.clientWidth-106',142,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv4','document.body.clientWidth-106',173,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv5','document.body.clientWidth-106',204,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv6','document.body.clientWidth-106',235,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv11',6,80,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv12',6,111,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv13',6,142,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv14',6,173,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv15',6,204,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.addItem('followDiv16',6,235,'<br><a href=http://www.flash8.net target=_blank><img src=http://www.020job.com/images/ad/zsnet.gif border=0></a>'); theFloaters.play(); </script>
</body>
</html>
theFloaters.addItem('followDiv1','document.body.clientWidth-106',80,'<br><a href=http://localhost/ggao/js.aspx?id=1 target=_blank><img src=http://localhost/ggao/tupian/1.gif border=0></a>');
//我改的这句,就显示不了,请问错在哪,应该怎样改写下面这段代码!
theFloaters.addItem('followDiv2','document.body.clientWidth-106',111,'<br><a href=http://www.flash8.net target=_blank> <img src=&{aabb} border=0></a>');//改成这样试试
theFloaters.addItem('followDiv2','document.body.clientWidth-106',111,'<br><a href=http://www.flash8.net target=_blank> <img src='+aabb+'} border=0></a>');
theFloaters.addItem('followDiv2','document.body.clientWidth-106',111,'<br><a href=http://www.flash8.net target=_blank> <img src='+aabb+'} border=0></a>');改成上面那样还是不行,。。55555急