(function($){ getInfomation(); function getInfomation(){ // var infoUrl ="http://" + window.location.host+'/icss-web/kl/introduce/get_by_itemidAndType'; // var infoUrl ="http://" + window.location.host+'/api/icss/introduceInfo/getByQuestionId'; var infoUrl ='http://192.168.2.236:5050/api/icss/introduceInfo/getByQuestionId' var imageUrlPrefix = 'http://192.168.2.236:82' var urlParam = parseUrlParams(); console.log(urlParam) var param = { "type": urlParam.type, "questionId": urlParam.questionId, position:2 }; $.ajax({ type: 'POST', url: infoUrl, data: JSON.stringify(param), headers: { // 'Accept': 'application/json, text/plain, */*', 'Content-Type':'application/json; charset=utf-8' }, success: function(res) { console.log(res) var str='',anchors='',item=''; if(!res.data){ $("h1").html("暂时没有数据"); return; } var list = res.data.introduceDetailList; $("h1").html(res.data.tagName); //list.map((item,i) =>{ for(var i=0;i' + item.title + '
  • '; str = '

    ' + item.title + '

    ' + '
    ' + item.content + '
    '; $(".infos").append(str); $(".anchors ul").append(anchors); //}); } addLinkClickEvent(); adjustHeight(); } }) // $.post(infoUrl,param,function(res){ // console.log('resssss', res) // if(res.ret == 0){ // var str='',anchors='',item=''; // if(!res.data){ // $("h1").html("暂时没有数据"); // return; // } // var list = res.data.introduceDetailList; // $("h1").html(res.data.shortName); // //list.map((item,i) =>{ // for(var i=0;i' + item.title + '
  • '; // str = '

    ' + item.title + // '

    ' + // '
    ' + item.description + '
    '; // $(".infos").append(str); // $(".anchors ul").append(anchors); // //}); // } // addLinkClickEvent(); // adjustHeight(); // }else{ // $(".container").html(res.msg); // } // } // ); } function parseUrlParams(){ var url = window.location.search; var params = url.substring(1).split("&"); var tmp = '',obj = {},it={}; //params.map((it) =>{ for(var i=0;ia").on("click",function(){ $(".active").removeClass('active'); $(this).parent().addClass("active"); }); } function adjustHeight(){ var ht = window.innerHeight; $(".content").height(ht-145+"px"); } })(jQuery);