Home  >  Article  >  Backend Development  >  javascript和html之间的交互有关问题,求高手解答

javascript和html之间的交互有关问题,求高手解答

WBOY
WBOYOriginal
2016-06-13 11:52:45820browse

javascript和html之间的交互问题,求高手解答
javascript 怎么通知php处理数据,然后返回结果,javascript继续处理,然后html显示?

------解决方案--------------------

<html><br /><head><br /><title></title><br /><script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script><br /><script type="text/javascript"><br />function click2()<br />{<br />alert("wwww");<br />$.ajax({<br />   type: "GET",<br />   url: "del.php",<br />   data: "num=3",<br />   success: function(msg){<br />     alert( "Data Saved: " + msg );<br />     //成功html显示结果<br />   }<br />});<br />}<br /></script><br /></head><br /><body><br /><input type="button" onclick="click2()" value="test"><br /></body><br /></html>

需要加载jquery文件啊 你都没加载怎么能成功呢

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn