在js文件中调用ajax代码

$(window).load(function() {
	 (function(){
			var treeUrl = '${pageContext.request.basePath }web/charts/chartsController/getTreeNode.do';
			$ajax(treeUrl,"get",{},function(result){  //初次进入树形初始化 
				mTree.initNodes(result,trees,imgPath);
				trees.drawTree();
			},function(){
				console.log("failed !");
			});
			
			
		})();
});

你可能感兴趣的:(在js文件中调用ajax代码)