作者alpe (薛丁格的猫)
看板Ajax
标题Re: [问题] 画图的问题
时间Tue Mar 20 15:52:14 2007
※ 引述《adddream (哆啦A孟)》之铭言:
: 继续上面的问题 我把function handleServerResponse()改为以下
: function handleServerResponse()
: {
: var response = xmlHttp.responseText;
: myDiv = document.getElementById("image1");
: myDiv.src="response";
: }
: <body onload="process()">
: <img id="image1" src="img">
: </body>
: 图好像出来了,不过他是个中间有一个x的图@@"
因为... ... 不能这样用 @@
如果你要这样用的话就是要跟 LPH66 说的那方式一样
变成
myDiv.src = 'data:image/gif;base64,'+ response ;
但就他说的 IE不能用...
从php 跟这看来 你不只要定时更新图档还有一些变数
我会很单纯的 javascript
<img id="tid" src="XX.php">
<script>
fucntion imgchange(get_var) {
var myDiv = ...
myDiv.src = 'XX.php' (get_var == '' )? '' :'?varname='+var ;
}
setInterval(imgchange, 1000); // 假设每秒更新一次
</script>
--
以上 以下
--
Exactly. For that one fraction of a second, you were open to options
you had never considered. THAT is the exploration that awaits you:
not mapping stars and studying nebulae,but
charting the unknown possibilities of existence.
Star Trek S7E26 "All Good Thing"
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.67.68.236
1F:→ adddream:THANKS ALL我在看看怎麽用,对web语法懂的不多@@ 03/20 18:33