像jquery的ajax类是如何编写的,看源代码就是看不懂。$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
}); 这种结构如何编写的?
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
}); 这种结构如何编写的?
解决方案 »
- 蹩脚的问题:如何获得extjs combobox中选择的是第几项....
- 像百度、腾讯等等大企业应该都有一些自己的bs系统的封装库
- ExtJs OS 挑战 Chrome OS ?
- ext treepanel checkebox
- 急问,关于splice的问题
- 偶遇一题:请写出获得javascript的方法的全部参数的代码片段
- 求判断是否为身份证号码的正则表达式
- 现在在Javascript中有两个方法function1,function2,我想循环调用这两个方法,如何办呀??
- swfupload组件后台获取中文文件名乱码
- 问问大伙有没有什么实战练习的js书籍
- js动态创建下拉菜单得到的不是我想要的
- 求高手帮我找错 我写的 javascript 代码执行出来不是我要的结果
下面给出一个例子:<select id="selectId" style="width:120;"></select><script>
var fillSelect = function(selectDom,jsonArray){
if(jsonArray.constructor !== Array){
alert('argument is not a Array!');
return;
}
for(var i = 0, j = jsonArray.length; i < j ; i++){
selectDom.options[i] = new Option(jsonArray[i].text,jsonArray[i].value);
if(jsonArray[i].selected){
selectDom.options[i].selected = true;
}
}
};
window.onload = function(){
var selObj = document.getElementById('selectId');
fillSelect(selObj,[{
text: '北京市',
value: 101
},{
text: '河北省',
value: 102
},{
text: '天津市',
value: 103,
selected: true
}]);
};
</script>