jquery教程ajax请求json数据示例


$.ajax({
            url: '这个地址要换成你自己的',
            data: {S_CourseID: courseid , CurrTime : new Date().getTime()}, //加个时间戳,否则会不自动更新数据
            dataType: 'json',
            success: function(data)
            {

                if (data != null) {

                    if ( data.length > 0) {

                         for(var i = 0 ; i < data.length ; i++){

                            specids = specids + data[i].S_SpecialtyID + ","; //获取JSON对象中的数据

                            coursetypeid = data[i].S_CourseTypeID ;

                        }

                        if (specids.length >0) {

                            specids = specids.substring(0,specids.length-1);

                        }

                    }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdypsz.html