下面的方法是用JQUERY的方法写的.如果换为JAVASCRIPT的方法,怎么写?
JAVASCRIPT代码如下:
var divShrink= document.querySelector("div.shrink"), divAjax= document.querySelector("div.ajax"); divShrink.onclick= function(){ $.get(targeturl,function(data){ $(divAjax).html(data); }) }
HTML部分代码如下:
<div class="shrink"> </div> <div class="ajax" targeturl="./pr-NeteaseMusic.html"> </div>
How to get the value of AJAX using JavaScript?-PHP Chinese website Q&A-How to get the value of AJAX using JavaScript?-PHP Chinese website Q&A
Look around and learn.