$.post("/sofpro/bmyyqt/info_count/info_count3.jsp?url="+window.location, function(data){ var llcs= $.trim(data); $("#view").html(llcs); }); if($("#zoomcon .Section1").length > 0){ $("#zoomcon .Section1").css('layout-grid',''); } if($("#zoomcon .WordSection1").length > 0){ $("#zoomcon .WordSection1").css('layout-grid',''); } //扫码浏览 document.write(""); document.write(""); document.write(""); //调整字体大小: var tgs = new Array( 'div','td','tr','font','p','span'); var fontsizePx = 16; // same as font-size in body /* *** Adjust Font Size *** */ function adjustFontsize(tag, sizechange) { if (!document.getElementById) return; var d = document,cEl = null,i,j,cTags; if( sizechange == 'larger' ) fontsizePx = 18; else if( sizechange == 'small' ) fontsizePx = 14; // same as font-size in body else if( sizechange == 'large') fontsizePx = 16; if ( !( cEl = d.getElementById( tag ) ) ) cEl = d.getElementsByTagName( tag )[ 0 ]; //debug(cEl); cEl.style.fontSize = fontsizePx + "px"; for ( i = 0 ; i < tgs.length ; i++ ) { cTags = cEl.getElementsByTagName( tgs[ i ] ); // t = cEl.all.tags(tgs[ i ]); //alert(tgs[i] +":" + cTags.length); for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = fontsizePx + "px"; } } //mp4格式视频兼容方法: function convertMedia(){ if (!document.getElementById("zoomcon")) return ; var mediaDom = document.getElementById("zoomcon").getElementsByTagName("embed") ; var videoDom = document.createElement("video") ; if (typeof(videoDom.canPlayType) != "undefined" && mediaDom && mediaDom.length > 0){ for(var i = 0 ; i < mediaDom.length ; i++) { var el = mediaDom[i] ; var newMediaDom = document.createElement("video") ; newMediaDom.setAttribute("controls" , "controls") ; newMediaDom.setAttribute("preload" , "preload") ; newMediaDom.setAttribute("src" , el.getAttribute("flashvars").replace(/^vcastr_file=/ , "")) ; newMediaDom.setAttribute("width" , "60%") ; // el.width newMediaDom.setAttribute("height" , "auto") ; // el.height var parentDom = el.parentNode ; el.style.display="none" ; parentDom.appendChild(newMediaDom) ; //parentDom.removeChild(el) ; } var len = mediaDom.length ; for(var i = 1 ; mediaDom.length > 0 ; i++ ) { var parentDom = mediaDom[0].parentNode ; parentDom.removeChild(mediaDom[0]) ; if (i >= len){ break ; } } } } convertMedia() ; //访问量 var hitsReq = "/cmsHits/r/hits/index"; var hitsCallbackFlag = true; var hitsCallbackName = "jsonpcallback"; var hitsHeadSiteName = "SiteIDCode"; var hitsJsManuName = "documentId"; var hitsHeadManuName = "documentId"; //稿件 try{ $().ready(function() { //稿件访问量 hitsManu(1,"#view",undefined); }); }catch(e){ } function hitsManu(view,el,id, url){ try { var type = 3; if (!id || id == undefined || id == null || id == "") { try{id=eval(hitsJsManuName);} catch (e) {} } if (!id || id == undefined || id == null || id == "") { id=$("head meta[name='"+hitsHeadManuName+"']").attr("content"); } if (!id || id == undefined || id == null || id == "") { //url上最后一层 稿件id try{ var hrefPathNameArr = window.location.pathname.split("/"); var urlEnd = hrefPathNameArr[hrefPathNameArr.length-1]; id = urlEnd.split(".", 2)[0]; }catch(e){ } } hitsCmsCommon(type,view,el,id, url); } catch (e) {try{console.error(err);} catch (e) {}} } function hitsCmsCommon(type,view,el,id, url) { try { if (!type || type == undefined || type == null || type == "") { //type = 3; return ; } if (!view || view == undefined || view == null || view == "") { //view = 3; return ; } if (!id || id == undefined || id == null || id == "") { return ; } if (!url || url == undefined || url == null || url == "") { url = window.location.href; } var reqData = { url : hitsReq, data : { "type" : type, "view" : view, "id" : id, "url" : url }, type : 'POST', success:function(ropData) { ropData = ropData+""; if(ropData && !ropData.startsWith("ERROR_")){ if((view==1 || view==2) && el && el != undefined && el != null){ $(el).text(ropData); } }else{ try{console.error(ropData);} catch (e) {} } }, error : function(err) { try{console.error(err);} catch (e) {} } }; if(hitsCallbackFlag){ reqData.dataType = 'jsonp'; reqData.jsonp = "callbackparam"; reqData.jsonpCallback = hitsCallbackName+"_"+type+"_"+view; }else{ reqData.dataType = 'text';//json } $.ajax(reqData); } catch (e) {} } //判断当前字符串是否以str开始 先判断是否存在function是避免和js原生方法冲突,自定义方法的效率不如原生的高 if (typeof String.prototype.startsWith != 'function'){ String.prototype.startsWith = function(str) { return this.slice(0, str.length) == str; }; }     //判断当前字符串是否以str结束 if (typeof String.prototype.endsWith != 'function') { String.prototype.endsWith = function(str) { return this.slice(-str.length) == str; }; }