Çë½Ì¸ßÈËjquery+json+ajaxÎÊÌ⣿£¿
JS Îļþ
var test={
show:function(){
var userifo=new Array();
userifo.push(1);
userifo.push(2);
userifo.push(3);
//alert("aaa");
$.ajax({
type :'POST',
url :"http://localhost/test/test1.php",
data :'aa',
dataType :'json',
async :false,
success : function(server) {
alert("bbb");
}
});
}
}
test.php Îļþ
<html>
<script type="text/javascript" src="./js/test.js"> </script>
<script type="text/javascript" src="./js/jquery-1.3.2.min.js"> </script>
<script type="text/javascript">
</script>
<body onload="test.show()">
this is my test!
</body>
</html>
test1.php
<?
echo "aaa";
?>
Ŀ¼ test ÏÂtest.php test1.php
ÏÂÒ»¼¶ js ÏÂjquery1.32.min.js test.js
Ϊʲǫ̂û·´Ó¦£¿ Ó¦¸ÃÊÇÄijöÎÊÌâÁË£¿
ÔõôûÈËѽ£¡×Ô¼º¶¥£¡
Ïà¹ØÎÊ´ð£º
µÚ14Õ µÄÊ÷ÐͲ˵¥µÄÀý×Ó²»ÄÜÔÚIEÖÐÕý³£ÏÔʾ£¨Ê÷µÄ½á¹¹¿ÉÒÔÕ¹¿ª£¬µ«Õ¹¿ªºóÔÙµã»÷¾Í²»ÄÜÊÕËõÁË£©£¬µ«ÄÜÔڹȸèä¯ÀÀÆ÷ÖÐʹÓã¬Óп´´ËÊéµÄÅóÓÑÄÜÖ¸µãÏÂÂð£¿
ºÃÌù ºÇ
dfgfgfgffffff
лл¡£
......
²é¿´Ô´Îļþʱ³öÀ´µÄ
<script type="text/javascript">
// <![CDATA[
Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(Sys.UI._Upd ......
JScript code:
function callback() {
alert(18); //²âÊÔÊÇ·ñµ÷ÓÃÁËcallback»Øµ÷º¯Êý
if (httpRequest.readyState==4) {
if(httpRequest.status==200){
alert(3); //²âÊÔÊ ......
var xmlHttp = null;
function Getxmlhttp()
{
var url = "update.php";
if (xmlHttp == null)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
&n ......