![](/img/trans.png)
[英]Clicking a button to run casperJS in PHP and echo results in same PHP page with button
[英]Run different code clicking a button while remaining on same page?
我在div id =“ 1”中輸入以下代碼:
<div id="1" style="margin-left: 0px; padding: 0px; float: left; width: 640px; height: 392px; border: 0px;">
<object width="640" height="392" classid="clsid:**************">
<param name="flashvars" value="cid=******&autoplay=true" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="src" value="http://www.ustream.tv/flash/viewer.swf" />
<embed flashvars="cid=******&autoplay=true" width="640" height="392" allowfullscreen="true" allowscriptaccess="always" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash"></embed>
</object>
</div>
我想保留在同一頁面上,單擊在同一div中加載新的新代碼的按鈕:
<div id="1" style="margin-left: 0px; padding: 0px; float: left; width: 640px; height: 392px; border: 0px;">
<iframe style="border: 0 none transparent;" src="//www.ustream.tv/embed/******?wmode=direct&autoplay=true" width="640" height="392" frameborder="no"></iframe>
</div>
使用純JavaScript,將以下代碼添加到您的按鈕onclick事件。
document.getElementById(“ 1”)。innerHTML =“您的代碼”;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.