jquery ajax的例子
生活随笔
收集整理的這篇文章主要介紹了
jquery ajax的例子
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先引入jquery.js文件
$(document).ready(function(){var root = location.href.slice(0, location.href.lastIndexOf('/'));var path = root + '/appgallery/config/appsConfig.json';//$("#imgId").attr('src',path); var childrens = $('body').find("#row")[0].children; //查找節點$.ajax({type:"GET",url: path,data:{},dataType: 'json',success:function(results){var centents = results.typicalAPPContents;for(var i=0;i<childrens.length-1;i++){var childs = childrens[i].children;//childs[0].attr("src",centents[i].image); 修改屬性 childs[0].src = centents[i].image;childs[1].href = centents[i].url;childs[1].text = centents[i].title;childs[2].innerText = centents[i].content;// childs[1]. }},error:function(){alert("沒有配置要打開的連接");}}); })
總結
以上是生活随笔為你收集整理的jquery ajax的例子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 设计模式的概念和分类
- 下一篇: rJava安装及Java 开发R