第一千七百四十章砸树!(2 / 2)

或在微信公众号里搜索"红薯中文网"{{else}}

微信公众号

微信内可长按识别

或在微信公众号里搜索"热血刊"{{/if}}

varsex_flag='nv';var_bid='';var_chapterid='';格式化参数functionformatparams(data){vararr=[];for(varnameindata){arr.push(encodeuricomponent(name)+"="+encodeuricomponent(data[name]));}arr.push(("v="+math.random()).replace(".",""));returnarr.join("&");}window.onerror=function(errormessage,scripturi,linenumber,columnnumber,errorobj){这里用原生的方法去截获if(!scripturi&&!linenumber&&!columnnumber){returntrue;}varurl="/jslog/index/sex_flag/nv.html";try{1.创建xmlhttprequest对象这是xmlhttpreuquest对象无部使用中最复杂的一步需要针对ie和其他类型的浏览器建立这个对象的不同方式写不同的代码varxmlhttprequest;if(window.xmlhttprequest){针对firefox,mozillar,opera,safari,ie7,ie8xmlhttprequest=newxmlhttprequest();针对某些特定版本的mozillar浏览器的bug进行修正if(xmlhttprequest.overridemimetype){xmlhttprequest.overridemimetype("text/xml");}}elseif(window.activexobject){针对ie6,ie5.5,ie5两个可以用于创建xmlhttprequest对象的控件名称,保存在一个js的数组中排在前面的版本较新varactivexname=["msxml2.xmlhttp","microsoft.xmlhttp"];for(vari=0;i=300||xmlhttprequest.statusvarua=window.navigator.useragent.tolowercase();varurl=parseurl('','restsajax/getwechatcfg','do');if(ua.match(/micromessenger/i)=='micromessenger'){if(typeof(weixinjsbridge)=="undefined"){if(document.addeventlistener){document.addeventlistener('weixinjsbridgeready',onbridgeready,false);}elseif(document.attachevent){document.attachevent('weixinjsbridgeready',onbridgeready);document.attachevent('onweixinjsbridgeready',onbridgeready);}}else{onbridgeready();}functiononbridgeready(){$.ajax({url:url,type:"post",data:{url:'https:m.hongshu.com/bookajax/orderchapter.do'},datatype:'json',success:function(json){if(json.hasownproperty('appid')&&json.appid){wx.config(json);var_href_=location.href;if(_href_.indexof('?')>-1){_href_=_href_+'&sid=772'}else{_href_=_href_+'?sid=772'}wx.ready(function(res){varsharedata={title:'红薯中文网',desc:'红薯中文网',link:_href_,分享链接imgurl:'https:img2.hongshu.com/public/client/html5/1.3.5/images/shareicon.png',分享图标type:'',分享类型,music、video或link,不填默认为linkdataurl:'',如果type是music或video,则要提供数据链接,默认为空success:function(){用户确认分享后执行的回调函数$.ajax({url:"/choujiangajax/getfenxiang.do",type:"post",data:'',success:function(json){if(json.url){hg_gotourl(json.url);}else{window.location.reload();}}})},cancel:function(){用户取消分享后执行的回调函数console.log('cancel');}};wx.onmenushareappmessage(sharedata);wx.onmenushareappmessage(sharedata);wx.onmenushareqq(sharedata);wx.onmenushareweibo(sharedata);wx.onmenushareqzone(sharedata);分享到朋友圈时只有标题,所这里拼接一下varcopy_sharedate={};$.extend(copy_sharedate,sharedata);copy_sharedate.title=copy_sharedate.title+""+copy_sharedate.desc;wx.onmenusharetimeline(copy_sharedate);});wx.error(function(res){hg_toast(res.errmsg);打印错误消息。及把debug:false,设置为debug:ture就可以直接在网页上看到弹出的错误提示});}}});}}