我对此很新,实际上这是我第一次尝试Dojo。我试图从网站获取数据:dojo.xhrGet or dojo.xhrPost
<script
text="text/javascript"
src="http://o.aolcdn.com/dojo/1.3/dojo/dojo.xd.js"
djConfig="parseOnLoad:true,isDebug:true"
></script>
<script type="text/javascript">
//How are we supposed to know what else to include in the dojo thing? like query?
dojo.addOnLoad(function(){
console.log("hi");
dojo.xhrPost({
url: "http://www.scrapbookingsuppliesrus.com/catalog/layout", //who knows how to set relative urls?
handleAs: "json", //get json data from server
load: function(response, ioArgs){
console.log("got");
console.log(response); //helps with the debugging
return response; //that way goods should be a very large array of the data we want
},
error: function(response, ioArgs){
console.log("nope didn't make it", response+' '+ioArgs); //helps with the debugging
return response; //who knows what this does
} //last item, thus no extra comma
});
});
</script>
但没有任何反应。当我在这时,响应和ioArgs变量究竟是什么。他们应该神奇地是对这个请求的回应,我想这已经是特别定义了。但是,谁知道。此外,我认为每次尝试后都会触发负载或错误,但可惜。 曾经有一个错误,我正在去一个被禁止的uri,但随后萤火虫会引用一个非常大的dojo脚本,在那里不可能说明它为什么被破坏。你们其他人在发展什么样的环境?