}) $('.like').one("click",function(){ var commentid = $(this).find('.zan').val(); //$(this).find('.zan').val(commentid+1); var good=$(this).find('.good').html(); //alert(good); var num1=parseFloat(good); var num2=parseFloat(1); var total =num1+num2; $(this).find('.good').html(total); $.ajax({ type:"get", url:"/index.php/Home/Baike/like.html?commentid="+commentid, data:"commentid="+commentid, dataType:"json", success:function(msg) { } }) }) $('#div').click(function(){ window.location.href="/index.php/Home/Other/baikenav.html"; }) $('#back').click(function(){ window.location.href="/index.php/Home/Baike/baike.html"; }) $('.lookAll').click(function(){ var commentid = $(this).find('.commentid').val(); //alert(commentid); //alert("123"); window.location.href="/index.php/Home/Baike/comment_detail.html?commentid="+commentid; }) $('.agree').one('click',function(){ var agree = $('.agree_').html(); var did = $('.did').val(); //alert(did); var num1=parseFloat(agree); var num2=parseFloat(1); var total =num1+num2; $('.agree_').html(total); $.ajax({ type:'get', url:"/index.php/Home/Baike/agree.html?did="+did, dataType:"json", success:function(msg) { } }) }) $('.login').click(function(){ var url = window.location.href; window.location.href="/index.php/Home/User/login?url="+url; }) $('.img img_l').removeAttr("style"); $('.img img_l').find('img').attr("style","width:100%;"); //$('.img img_l').find('img').before("
"); //$('.hpic').before("
"); $('.hpic').attr("style","width:100%;"); $.each($(".floor-one-three a"),function(i,val){ if($(this).attr("href")){ if($(this).attr("href").indexOf("http://") == -1 && $(this).attr("href").indexOf("https://") == -1){ $(this).attr({href: "http://baike.ipa361.com/"+$(this).attr("href")}) } } }) $.each($(".floor-one-three img"),function(i,val){ if($(this).attr("src")){ if($(this).attr("src").indexOf("http://") == -1 && $(this).attr("src").indexOf("https://") == -1){ $(this).attr({src: "http://baike.ipa361.com/"+$(this).attr("src")}) } } }) $(".floor-one-three img").css({width:"100%"}) //点赏 var m1 = new MyModal.modal(function() { var options=$("#list li input:checked"); //获取选中的项 var coin=options.val(); //拿到选中项的值 console.log(coin) $.ajax({ url:"/index.php/Home/Other/reward.html", type:"post", data:{ coin:coin, author_id:17236 }, success:function(e){ console.log(e) var aa=JSON.parse(e) if(""!=aa.href&&null!=aa.href){ window.location.href=aa.href; }else { alert(aa.msg) } } }) }); $('.btn1').on("click", function() { //alert(1) m1.show(); }); //添加收藏 var n=0; $(".collect").on('click',function(){ n++; //判断是否点击过 //console.log(n) var Url=window.location.href//获取当前页面链接 //console.log(Url) var title=$(".floor-one-one>div").html() console.log(title) if(n==1){ $.ajax({ type:'post', url:"/index.php/Home/Other/addMCollection.html", dataType:"json", data:{url:Url,title:title,cate_id:2}, success:function(msg){ console.log(msg) var tz=msg.href console.log(tz) if(""!=tz&&null!=tz){ window.location.href=tz; }else { alert(msg.msg) } } }) }else{ alert("已添加到收藏") } })