看板 Ajax 關於我們 聯絡資訊
※ 引述《CoMix (CoMix)》之銘言: : 我有兩個網頁 : A.php B.php : │ │ : └ function go(); └ function show(); : 我想從 A.php function go(); 中去呼叫使用 B.php function show(); : 請問這樣是可以實現的嘛 ~ 應該怎麼寫才可以達到我要的目的 用iframe試作如下: A.php內容: <html> <body> <iframe src="B.php" id="target" name="target" style="display:none"></iframe> <script> function go(){ try { window.frames['target'].show(); } catch(e) { alert(e); } }; window.setTimeout(function(){go();},100); </script> </body> </html> B.php內容: <html> <script> function show() { alert("show"); } </script> <body> </body> </html> PS.因為你是在ajax版問,所以我假設你說的function go()與show()都是javascript的 function。 -- Sapere Aude! 這就是啟蒙運動的口號! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.250.95.16
clonn:這個或許對你有些幫助 http://tinyurl.com/c7o296 02/25 01:56
clonn:我不是張爸 02/25 01:57