- <span style="white-space:pre"> </span>function xxx(){
- $.ajax({
- url:basePath + "/themeMsg/getInitData.do",
- type:"POST",
- data:{},
- cache:false,
- dataType:'json',
- success:function(data){
- var html = "";
- $(".header-txt > a").attr('href',data.downloadSoftUrl);
- $.each(data.hotKeys, function(i,item){
- html += "<a href=" + basePath + "/themeMsg/searchThemesByHotKey.do?hotname=" + item.hotname+">" + item.hotname +"</a>";
- });
- $(".hot-label").append(html);
- if(data.isClose == "true"){
- $(".header.header-2.clearfix").hide();
- }
- }
- });
- }
若返回回来的数据非json格式,则不会执行回调函数,即不执行success后面的js脚本