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

WBOY
Release: 2016-06-13 11:52:45
Original
827 people have browsed it

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>
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!