---
title: "ajax异步获取数据"
author: "corelengine"
date: "2013-11-15T21:24:04Z"
tags: []
categories: ["Web前端"]
slug: "ajax"
draft: false
lastmod: "2013-11-15T21:24:04Z"
id: 1975806
url: "https://corelengine.iteye.com/blog/1975806"
---

&lt;script src="../js/json2.js"&gt;&lt;/script&gt;

 

function getCloundNotes() {

var strData = "";

var cloudNotesData = {};

var moduleArray = \["taskCenter", "calendar", "notice", "others"];

 

for (var i = 0; i &lt; moduleArray.length; i++) {

 

var aj = $.ajax({

url : 'http://192.168.114.117:9080/GeneralSHPlatform/listNote.action',

data : {

"personid" : "LJ",

"pagesize" : 1,

"pageno" : 1,

"module" : moduleArray\[i]

},

type : 'post',

cache : false,

dataType : 'json',

                        async: false,

success : function(data) {

strData = JSON.stringify(data.responseTxt);

alert("strData:" + strData);

},

error : function() {

alert("异常！");

}

});

 

}

 

// alert("ok:"+JSON.stringify(data.responseTxt) );

}