Re: [問題] 畫圖的問題

看板Ajax作者 (薛丁格的貓)時間17年前 (2007/03/20 15:52), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串5/6 (看更多)
※ 引述《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

03/20 18:33, , 1F
THANKS ALL我在看看怎麼用,對web語法懂的不多@@
03/20 18:33, 1F
文章代碼(AID): #15_vAnjH (Ajax)
討論串 (同標題文章)
文章代碼(AID): #15_vAnjH (Ajax)