JS的document详细学习.docx

上传人:b****5 文档编号:6009454 上传时间:2023-01-02 格式:DOCX 页数:8 大小:16.80KB
下载 相关 举报
JS的document详细学习.docx_第1页
第1页 / 共8页
JS的document详细学习.docx_第2页
第2页 / 共8页
JS的document详细学习.docx_第3页
第3页 / 共8页
JS的document详细学习.docx_第4页
第4页 / 共8页
JS的document详细学习.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

JS的document详细学习.docx

《JS的document详细学习.docx》由会员分享,可在线阅读,更多相关《JS的document详细学习.docx(8页珍藏版)》请在冰豆网上搜索。

JS的document详细学习.docx

JS的document详细学习

JS的document详细学习(Document是HTML语言中的一类对象。

document文挡对象-JavaScript脚本语言描述

---------------------------------------------------------------------

注:

页面上元素name属性和JavaScript引用的名称必须一致包括大小写

  否则会提示你一个错误信息"引用的元素为空或者不是对象"

---------------------------------------------------------------------

对象属性

document.title             //设置文档标题等价于HTML的标签</p><p>document.bgColor           //设置页面背景色</p><p>document.fgColor           //设置前景色(文本颜色)</p><p>document.linkColor         //未点击过的链接颜色</p><p>document.alinkColor        //激活链接(焦点在此链接上)的颜色</p><p>document.vlinkColor        //已点击过的链接颜色</p><p>document.URL               //设置URL属性从而在同一窗口打开另一网页</p><p>document.fileCreatedDate   //文件建立日期,只读属性</p><p>document.fileModifiedDate  //文件修改日期,只读属性</p><p>document.fileSize          //文件大小,只读属性</p><p>document.cookie            //设置和读出cookie</p><p>document.charset           //设置字符集简体中文:</p><p>gb2312</p><p>---------------------------------------------------------------------</p><p>常用对象方法</p><p>document.write()                  //动态向页面写入内容</p><p>document.createElement(Tag)       //创建一个html标签对象</p><p>document.getElementById(ID)       //获得指定ID值的对象</p><p>document.getElementsByName(Name)  //获得指定Name值的对象</p><p>document.body.appendChild(oTag)</p><p>---------------------------------------------------------------------</p><p>body-主体子对象</p><p>document.body               //指定文档主体的开始和结束等价于<body></body></p><p>document.body.bgColor       //设置或获取对象后面的背景颜色</p><p>document.body.link          //未点击过的链接颜色</p><p>document.body.alink         //激活链接(焦点在此链接上)的颜色</p><p>document.body.vlink         //已点击过的链接颜色</p><p>document.body.text          //文本色</p><p>document.body.innerText     //设置<body>...</body>之间的文本</p><p>document.body.innerHTML     //设置<body>...</body>之间的HTML代码</p><p>document.body.topMargin     //页面上边距</p><p>document.body.leftMargin    //页面左边距</p><p>document.body.rightMargin   //页面右边距</p><p>document.body.bottomMargin  //页面下边距</p><p>document.body.background    //背景图片</p><p>document.body.appendChild(oTag)//动态生成一个HTML对象</p><p>常用对象事件</p><p>document.body.onclick="func()"          //鼠标指针单击对象是触发</p><p>document.body.onmouseover="func()"      //鼠标指针移到对象时触发</p><p>document.body.onmouseout="func()"       //鼠标指针移出对象时触发</p><p> </p><p> </p><p>location-位置子对象</p><p>document.location.hash      //#号后的部分</p><p>document.location.host      //域名+端口号</p><p>document.location.hostname  //域名</p><p>document.location.href      //完整URL</p><p>document.location.pathname  //目录部分</p><p>document.location.port      //端口号</p><p>document.location.protocol  //网络协议(http:</p><p>)</p><p>document.location.search    //?</p><p>号后的部分</p><p>documeny.location.reload()      //刷新网页</p><p>document.location.reload(URL)   //打开新的网页</p><p>document.location.assign(URL)   //打开新的网页</p><p>document.location.replace(URL)  //打开新的网页</p><p>---------------------------------------------------------------------</p><p>selection-选区子对象</p><p>document.selection</p><p>---------------------------------------------------------------------</p><p>images集合(页面中的图象)</p><p>a)通过集合引用</p><p>document.images             //对应页面上的<img>标签</p><p>document.images.length      //对应页面上<img>标签的个数</p><p>document.images[0]          //第1个<img>标签         </p><p>document.images[i]          //第i-1个<img>标签</p><p>b)通过nane属性直接引用</p><p><imgname="oImage"></p><p>document.images.oImage      //document.images.name属性</p><p>c)引用图片的src属性</p><p>document.images.oImage.src  //document.images.name属性.src</p><p>d)创建一个图象</p><p>varoImage</p><p>oImage=newImage()</p><p>document.images.oImage.src="1.jpg"</p><p>同时在页面上建立一个<img>标签与之对应就可以显示</p><p><html></p><p><imgname=oImage></p><p><scriptlanguage="javascript"></p><p>   varoImage</p><p>   oImage=newImage()</p><p>   document.images.oImage.src="1.jpg"</p><p></script></p><p></html></p><p><html></p><p><scriptlanguage="javascript"></p><p>   oImage=document.caeateElement("IMG")</p><p>   oImage.src="1.jpg"</p><p>   document.body.appendChild(oImage)</p><p></script></p><p></html></p><p>----------------------------------------------------------------------</p><p>forms集合(页面中的表单)</p><p>a)通过集合引用</p><p>document.forms                 //对应页面上的<form>标签</p><p>document.forms.length          //对应页面上<form>标签的个数</p><p>document.forms[0]              //第1个<form>标签</p><p>document.forms[i]              //第i-1个<form>标签</p><p>document.forms[i].length       //第i-1个<form>中的控件数</p><p>document.forms[i].elements[j]  //第i-1个<form>中第j-1个控件</p><p>b)通过标签name属性直接引用</p><p><formname="Myform"><inputname="myctrl"></form></p><p>document.Myform.myctrl         //document.表单名.控件名</p><p>c)访问表单的属性</p><p>document.forms[i].name         //对应<formname>属性</p><p>document.forms[i].action       //对应<formaction>属性</p><p>document.forms[i].encoding     //对应<formenctype>属性</p><p>document.forms[i].target       //对应<formtarget>属性</p><p>document.forms[i].appendChild(oTag)//动态插入一个控件</p><p>-----------------------------------------------------------------------</p><p><html></p><p><!</p><p>--Text控件相关Script--></p><p><formname="Myform"></p><p><inputtype="text"name="oText"></p><p><inputtype="password"name="oPswd"></p><p><form></p><p><scriptlanguage="javascript"></p><p>//获取文本密码框的值</p><p>document.write(document.Myform.oText.value)</p><p>document.write(document.Myform.oPswd.value)</p><p></script></p><p></html></p><p>-----------------------------------------------------------------------</p><p><html></p><p><!</p><p>--checkbox,radio控件相关script--></p><p><formname="Myform"></p><p><inputtype="checkbox"name="chk"value="1">1    </p><p><inputtype="checkbox"name="chk"value="2">2    </p><p></form>    </p><p><scriptlanguage="javascript">    </p><p>functionfun(){    </p><p>  //遍历checkbox控件的值并判断是否选中   </p><p>  varlength    </p><p>  length=document.forms[0].chk.length    </p><p>  for(i=0;i<length;i++){    </p><p>  v=document.forms[0].chk[i].value    </p><p>  b=document.forms[0].chk[i].checked    </p><p>  if(b)    </p><p>    alert(v=v+"被选中")    </p><p>  else    </p><p>    alert(v=v+"未选中")   </p><p>  }    </p><p>  }    </p><p></script>     </p><p><ahref=#onclick="fun()">ddd</a>                     </p><p></html></p><p>-----------------------------------------------------------------------</p><p><html></p><p><!</p><p>--Select控件相关Script--></p><p><formname="Myform"></p><p><selectname="oSelect"></p><p><optionvalue="1">1</option></p><p><optionvalue="2">2</option></p><p><optionvalue="3">3</option></p><p></select></p><p></form></p><p><scriptlanguage="javascript"></p><p>   //遍历select控件的option项</p><p>   varlength</p><p>   length=document.Myform.oSelect.length</p><p>   for(i=0;i<length;i++)</p><p>   document.write(document.Myform.oSelect[i].value)</p><p></script></p><p><scriptlanguage="javascript"></p><p>   //遍历option项并且判断某个option是否被选中</p><p>   for(i=0;i<document.Myform.oSelect.length;i++){</p><p>   if(document.Myform.oSelect[i].selected!</p><p>=true)</p><p>   document.write(document.Myform.oSelect[i].value)</p><p>   else</p><p>   document.write("<fontcolor=red>"+document.Myform.oSelect[i].value+"</font>")  </p><p>   }</p><p></script></p><p><scriptlanguage="javascript"></p><p>   //根据SelectedIndex打印出选中的option</p><p>   //(0到document.Myform.oSelect.length-1)</p><p>   i=document.Myform.oSelect.selectedIndex</p><p>   document.write(document.Myform.oSelect[i].value)</p><p></script></p><p><scriptlanguage="javascript"></p><p>   //动态增加select控件的option项</p><p>   varoOption=document.createElement("OPTION");</p><p>   oOption.text="4";</p><p>   oOption.value="4";</p><p>   document.Myform.oSelect.add(oOption);</p><p></script></p><p><html></p><p> </p><p> </p><p> </p><p> </p><p><Divid="oDiv">Text</Div></p><p>document.all.oDiv                              //引用图层oDiv               </p><p>document.all.oDiv.style.display=""             //图层设置为可视</p><p>document.all.oDiv.style.display="none"         //图层设置为隐藏</p><p>document.getElementId("oDiv")                  //通过getElementId引用对象</p><p>document.getElementId("oDiv").style=""</p><p>document.getElementId("oDiv").display="none"</p><p>/*document.all表示document中所有对象的集合</p><p>只有ie支持此属性,因此也用来判断浏览器的种类*/</p><p>图层对象的4个属性</p><p>document.getElementById("ID").innerText  //动态输出文本</p><p>document.getElementById("ID").innerHTML  //动态输出HTML</p><p>document.getElementById("ID").outerText  //同innerText</p><p>document.getElementById("ID").outerHTML  //同innerHTML</p><p><html></p><p><scriptlanguage="javascript"></p><p>functionchange(){</p><p>document.all.oDiv.style.display="none"</p><p>}</p><p></script></p><p><Divid="oDiv"onclick="change()">Text</Div></p><p></html></p><p><html></p><p><scriptlanguage="javascript"></p><p>functionchangeText(){</p><p>document.getElementById("oDiv").innerText="NewText"</p><p>}</p><p></script></p><p><Divid="oDiv"onmouseover="changeText()">Text</Div></p><p></html></p><p></p> </div> <div class="readmore" onclick="showmore()" style="background-color:transparent; height:auto; margin:0px 0px; padding:20px 0px 0px 0px;"><span class="btn-readmore" style="background-color:transparent;"><em style=" font-style:normal">展开</em>阅读全文<i></i></span></div> <script> function showmore() { $(".readmore").hide(); $(".detail-article").css({ "height":"auto", "overflow": "hidden" }); } $(document).ready(function() { var dh = $(".detail-article").height(); if(dh >100) { $(".detail-article").css({ "height":"100px", "overflow": "hidden" }); } else { $(".readmore").hide(); } }); </script> </div> <script> var defaultShowPage = parseInt("5"); var id = "6009454"; var total_page = "8"; var mfull = false; var mshow = false; function DownLoad() { window.location.href='https://m.bdocx.com/down/6009454.html'; } function relate() { var reltop = $('#relate').offset().top-50; $("html,body").animate({ scrollTop: reltop }, 500); } </script> <script> var pre = "https://file1.bdocx.com/fileroot1/2023-1/2/046f44c5-ac68-4d15-9a51-d976d409caed/046f44c5-ac68-4d15-9a51-d976d409caed"; var freepage = parseInt('8'); var total_c = parseInt('8'); var start = defaultShowPage; var adcount = 0; var adindex = 0; var adType_list = ";0;1;2;3;4;5;6;7;"; var end = start; function ShowSvg() { end = start + defaultShowPage; if (end > freepage) end = freepage; for (var i = start; i < end; i++) { var imgurl = pre + (i + 1) + '.gif'; var html = "<img src='" + imgurl + "' onerror=\"this.src='/images/s.gif'\" alt=\"JS的document详细学习.docx_第" + (i + 1) + "页\" width='100%'/>"; $("#page").append("<div class='page'>" + html + "</div>"); $("#page").append("<div class='pageSize'>第" + (i + 1) + "页 / 共" + total_c + "页</div>"); if(adcount > 0 && adType_list.indexOf(";"+(i+1)+";")>-1) { if(adindex > (adcount-1)) adindex = 0; $("#page").append("<div class='pagead' id='addiv"+(i + 1)+"'></div>"); document.getElementById("addiv"+(i + 1)+"").innerHTML =document.getElementById("adpre" + adindex).outerHTML; adindex += 1; } } start = end; if (start > (freepage - 1)) { if (start < total_c) { $("#pageMore").removeClass("btnmore"); $("#pageMore").html("亲,该文档总共" + total_c + "页,到这儿已超出免费预览范围,如果喜欢就下载吧!"); } else { $("#pageMore").removeClass("btnmore"); $("#pageMore").html("亲,该文档总共" + total_c + "页全部预览完了,如果喜欢就下载吧!"); } } } //$(document).ready(function () { // ShowSvg(); //}); </script> <div id="relate" class="container" style="padding:0px 0px 15px 0px; margin-top:20px; border:solid 1px #dceef8"> <div style=" font-size: 16px; background-color:#e5f0f7; margin-bottom:5px; font-weight: bold; text-indent:10px; line-height: 40px; height:40px; padding-bottom: 0px;">相关资源</div> <div id="relatelist" style="padding-left:5px;"> <ul> <li><em class="xls"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866042.html" title="质量控制计划表格范例.xls">质量控制计划表格范例.xls</a> </li><li><em class="xls"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866041.html" title="陈会昌气质量表-含性格分析-.xls">陈会昌气质量表-含性格分析-.xls</a> </li><li><em class="xlsx"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866040.html" title="长租公寓测算表【经营测算1年、10年含公式和示例】.xlsx">长租公寓测算表【经营测算1年、10年含公式和示例】.xlsx</a> </li><li><em class="xls"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866039.html" title="高效导热材料介绍.xls">高效导热材料介绍.xls</a> </li><li><em class="xls"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866038.html" title="管道开挖回填基础工程量计算表.xls">管道开挖回填基础工程量计算表.xls</a> </li><li><em class="docx"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866037.html" title="2023年监理工程师延续注册必修课48学时试卷及答案.docx">2023年监理工程师延续注册必修课48学时试卷及答案.docx</a> </li><li><em class="doc"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866036.html" title="(美)麦克米兰公司英语900句183;基础篇.doc">(美)麦克米兰公司英语900句183;基础篇.doc</a> </li><li><em class="xls"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866035.html" title="习题7-1.xls">习题7-1.xls</a> </li><li><em class="xlsx"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866034.html" title="用Excel编写公式模板计算医学决定水平处的偏倚.xlsx">用Excel编写公式模板计算医学决定水平处的偏倚.xlsx</a> </li><li><em class="xls"/></em><a target="_parent" href="https://m.bdocx.com/doc/30866033.html" title="烧结机产量和原料计算表.xls">烧结机产量和原料计算表.xls</a> </li> </ul> </div> </div> <div class="container" style="padding:0px 0px 15px 0px; margin-top:20px; border:solid 1px #dceef8"> <div style=" font-size: 16px; background-color:#e5f0f7; margin-bottom:5px; font-weight: bold; text-indent:10px; line-height: 40px; height:40px; padding-bottom: 0px;">猜你喜欢</div> <div id="relatelist" style="padding-left:5px;"> <ul> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197649.html" target="_parent" title="财务管理经济地理学讲义中心地理论.docx">财务管理经济地理学讲义中心地理论.docx</a></li> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197650.html" target="_parent" title="行政执法协商和解.docx">行政执法协商和解.docx</a></li> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197651.html" target="_parent" title="高三语文一轮复习 专题二 文言文阅读课案训练二 Word版含答案doc.docx">高三语文一轮复习 专题二 文言文阅读课案训练二 Word版含答案doc.docx</a></li> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197652.html" target="_parent" title="含答案及解析一级建造师《项目管理》复习题集第六章第三节合同计价10页word文档.docx">含答案及解析一级建造师《项目管理》复习题集第六章第三节合同计价10页word文档.docx</a></li> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197653.html" target="_parent" title="档案盒正面侧面标签模板.docx">档案盒正面侧面标签模板.docx</a></li> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197654.html" target="_parent" title="电大本科毕业论文提纲模板最新范本模板.docx">电大本科毕业论文提纲模板最新范本模板.docx</a></li> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197655.html" target="_parent" title="冬季焊接施工方案.docx">冬季焊接施工方案.docx</a></li> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197656.html" target="_parent" title="东南大学健美操理论考试答案.docx">东南大学健美操理论考试答案.docx</a></li> <li><em class="docx"></em> <a href="https://m.bdocx.com/doc/5197657.html" target="_parent" title="古法针灸行针补泄运气行气手法.docx">古法针灸行针补泄运气行气手法.docx</a></li> </ul> </div> </div> <div style=" font-size: 16px; background-color:#e5f0f7; margin-top:20px; font-weight: bold; text-indent:10px; line-height: 40px; height:40px; padding-bottom: 0px; margin-bottom:10px;"> 相关搜索</div> <div class="widget-box pt0" style="border: none; padding:0px 5px;"> <ul class="taglist--inline multi"> <li class="tagPopup"><a target="_parent" class="tag tagsearch" rel="nofollow" href="https://m.bdocx.com/search.html?q=JS">JS</a></li> <li class="tagPopup"><a target="_parent" class="tag tagsearch" rel="nofollow" href="https://m.bdocx.com/search.html?q=document">document</a></li> <li class="tagPopup"><a target="_parent" class="tag tagsearch" rel="nofollow" href="https://m.bdocx.com/search.html?q=%e8%af%a6%e7%bb%86">详细</a></li> <li class="tagPopup"><a target="_parent" class="tag tagsearch" rel="nofollow" href="https://m.bdocx.com/search.html?q=%e5%ad%a6%e4%b9%a0">学习</a></li> </ul> </div> <br /> <div > 当前位置:<a target="_parent" href="https://m.bdocx.com/">首页</a> > <a href="https://m.bdocx.com/booklist-00009.html">求职职场</a><span> > </span><a href="https://m.bdocx.com/booklist-0000900001.html">简历</a> </div> <br /> <div class="cssnone"> <iframe title="来源" src="https://m.bdocx.com/BookRead.aspx?id=HkPKeAaCmEg%3d&parto=o77%2fW1yfik6JHmSW%2biPnXu7HwNKvcSgDy7SvAaUM%2bAtrrubvS8ir8uhYVHLlkPa24h8Gs%2bRS1j45EcVIgXG60Lho3jgdD1nCyDdY6aw7TOq6k9Vxuwx%2fUEKIEoLdyEd3nB5srKfWud1P2zkhU3iZpd6c5ADyU8Vhr16d8WWH%2f8a9BWtxSmbGz52v9AZ%2bGSaHe1eHs4m8UAlU9yekln2PCmVYwuohgOUw" frameborder="0" style="width: 0px; height: 0px"> </iframe> </div> <span id="LabelScript"></span> <script src="https://mstatic.bdocx.com/JS/bootstrap-collapse.js"></script> </form> <div class="siteInner_bg" style="margin-top: 40px; border: solid 0px red; margin-left: 0px; margin-right: 0px;"> <div class="siteInner"> <p style="text-align: center;">copyright@ 2008-2022 冰豆网网站版权所有</p><p style="text-align: center;">经营许可证编号:<a href="http://beian.miit.gov.cn/" target="_blank">鄂ICP备2022015515号-1</a></p><script>var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?2e77bd3f6fe91b0e21d3f22267249ee3"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();</script><script>(function(){ var el = document.createElement("script"); el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?81476e42bf626128cf29544ee216a8ed7deb9487dce7ed62313212129c4244a219d1c501ebd3301f5e2290626f5b53d078c8250527fa0dfd9783a026ff3cf719"; el.id = "ttzz"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(el, s); })(window)</script> </div> </div> <div class="trnav clearfix" id="navcontent" style="display: none; background-color:#3a71b1; "> <div class="trlogoside" id="navlogo" style="display: none;"> <a href="https://m.bdocx.com/" title="冰豆网"><img src="https://www.bdocx.com/images/logo_bd.png" alt="冰豆网"></a> <div class="trnavclose" id="navclose"> <span></span> </div> </div> <div class="navcontainer"> <div class="row"> <ul class="nav navbar-nav trnavul headercontent" id="navigation" style="margin:20px 0 0px;"> <li><a target="_parent"href="https://m.bdocx.com/login.aspx">登录</a></li> <li><a target="_parent"href="https://m.bdocx.com/">首页 </a></li> <li><a target="_parent"href="https://m.bdocx.com/booklist-0.html">资源分类 </a></li> <li><a target="_parent"href="https://m.bdocx.com/UserManage/Recharge.aspx?f=0"><img src="https://m.bdocx.com/images/s.gif" alt="new" class="hottip1">升级会员 <img src="https://www.bdocx.com/FileUpload/Images/48520fea-bc98-41ae-b183-84689c7075c9.gif" alt="new" class="hottip"></a></li> <li><a target="_parent"href="https://m.bdocx.com/newslist.html">通知公告 </a></li> <li><a target="_parent"href="https://m.bdocx.com/h-0.html">帮助中心 </a></li> </ul> </div> </div> </div> <script type="text/javascript"> function stopPropagation(e) { var ev = e || window.event; if (ev.stopPropagation) { ev.stopPropagation(); } else if (window.event) { window.event.cancelBubble = true;//兼容IE } } $("#navmore").click(function (e) { $("#navcontent").show(); $("#navlogo").show(); stopPropagation(e); var navcontentwidth = $("#navcontent").width(); $('#navcontent').css({ 'right': '-' + navcontentwidth + 'px' }); $("#navcontent").show().animate({ "right": 0 }, 300); }); $(document).bind('click', function () { var navcontentwidth = $("#navcontent").width(); $("#navcontent").animate({ 'right': '-' + navcontentwidth + 'px' }, 300, function () { $("#navcontent").hide(); }); $("#navlogo").fadeOut(300); }); $("#navcontent").click(function (e) { stopPropagation(e); }); $("#navclose").click(function (e) { var navcontentwidth = $("#navcontent").width(); $("#navcontent").animate({ 'right': '-' + navcontentwidth + 'px' }, 300, function () { $("#navcontent").hide(); }); $("#navlogo").fadeOut(300); }); </script> <script> function BaseShare(title, desc, imgUrl) { var link = "https://m.bdocx.com/doc/6009454.html"; if (wx) { wx.config({ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: 'wx4f717640abfd1120', // 必填,公众号的唯一标识 timestamp: '1722859124', // 必填,生成签名的时间戳 nonceStr: '06EB61B839A0CEFEE4967C67CCB099DC', // 必填,生成签名的随机串 signature: 'f14333338d76e74c83fa413492cde789d9877a78',// 必填,签名,见附录1 jsApiList: ['onMenuShareAppMessage', 'onMenuShareTimeline', 'updateAppMessageShareData', 'updateTimelineShareData', 'hideMenuItems'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 //openTagList: ["wx-open-launch-weapp"]//H5打开小程序 }); wx.ready(function () { //需在用户可能点击分享按钮前就先调用 wx.hideMenuItems({// 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3 menuList: ['menuItem:share:qq', 'menuItem:favorite', 'menuItem:share:QZone', 'menuItem:share:email', 'menuItem:originPage', 'menuItem:readMode', 'menuItem:delete', 'menuItem:editTag', 'menuItem:share:facebook', 'menuItem:share:weiboApp', 'menuItem:share:brand'] }); var shareData = { title: title, // 分享标题 desc: desc,//这里请特别注意是要去除html link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: imgUrl, // 分享图标 }; wx.updateAppMessageShareData(shareData);//1.4 分享到朋友 wx.updateTimelineShareData(shareData);//1.4分享到朋友圈 }); } } function BaseShare(title, desc, imgUrl, link) { if (link=="") link = "https://m.bdocx.com/doc/6009454.html"; if (wx) { wx.config({ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: 'wx4f717640abfd1120', // 必填,公众号的唯一标识 timestamp: '1722859124', // 必填,生成签名的时间戳 nonceStr: '06EB61B839A0CEFEE4967C67CCB099DC', // 必填,生成签名的随机串 signature: 'f14333338d76e74c83fa413492cde789d9877a78',// 必填,签名,见附录1 jsApiList: ['onMenuShareAppMessage', 'onMenuShareTimeline', 'updateAppMessageShareData', 'updateTimelineShareData', 'hideMenuItems'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 //openTagList: ["wx-open-launch-weapp"]//H5打开小程序 }); wx.ready(function () { //需在用户可能点击分享按钮前就先调用 wx.hideMenuItems({// 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3 menuList: ['menuItem:share:qq', 'menuItem:favorite', 'menuItem:share:QZone', 'menuItem:share:email', 'menuItem:originPage', 'menuItem:readMode', 'menuItem:delete', 'menuItem:editTag', 'menuItem:share:facebook', 'menuItem:share:weiboApp', 'menuItem:share:brand'] }); var shareData = { title: title, // 分享标题 desc: desc,//这里请特别注意是要去除html link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: imgUrl, // 分享图标 }; wx.updateAppMessageShareData(shareData);//1.4 分享到朋友 wx.updateTimelineShareData(shareData);//1.4分享到朋友圈 }); } } </script> <script> $(document).ready(function () { var arr = $(".headercontent"); for (var i = 0; i < arr.length; i++) { (function (index) { var url = "https://m.bdocx.com/header.aspx"; $.get(url + "?t=" + (new Date()).valueOf(), function (d) { try { arr.eq(index).empty().html(d); } catch (e) { } try { arr.html(d); } catch (e) { } }); })(i); } }); </script> <script src="https://mstatic.bdocx.com/js/jquery.lazyload.js"></script> <script charset="utf-8"> $("img.lazys").lazyload({ threshold: 200, effect: "fadeIn" }); </script> </body> </html>