javascript文档对象模型是什么-大悟县灿优商贸网站建设

关于灿优商贸

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

javascript文档对象模型是什么

这篇文章主要介绍“javascript文档对象模型是什么”,在日常操作中,相信很多人在javascript文档对象模型是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”javascript文档对象模型是什么”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

网站建设哪家好,找创新互联公司!专注于网页设计、网站建设、微信开发、小程序设计、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了新昌免费建站欢迎大家使用!

javascript文档对象模型是树型。文档对象模型(DOM)是W3C组织推荐的处理可扩展标记语言的标准编程接口,是一种基于树的API文档。

javascript文档对象模型是什么

本教程操作环境:windows7系统、javascript1.8.5版、Dell G3电脑。

在javascript中,文档对象模型是树型。

文档对象模型(Document Object Model,简称DOM),是W3C组织推荐的处理可扩展标记语言的标准编程接口 DOM是一种基于树的API文档。

  • 文档:真实存在的文件 例如:网页文件(HTML文本)

  • 对象:独立的数据集合 例如:文档对象 文档中元素与内容的数据集合

  • 模型:文档对象表示为树形模型 在这个树形模型中,网页的元素与内容表现为一个个节点

javascript文档对象模型是什么

javascript文档对象模型是什么

Window对象的属性:

  • parent :

    父窗口对象,与包含某个窗口的父窗口含义相同 self : 本窗口,与引用当前窗口含义相同 top : 指一系列嵌套窗口中的最上层浏览器窗口 frames : window对象中包含的所有frame对象的数组 document : 表示窗口中显示的当前文档对象 history : 窗口的history对象,包含窗口中最近访问的URL清单 location : 表示与window对象相关联的URL地址 event : 窗口事件对象(Only for IE) name : 窗口名称 opener : 表示打开窗口的window对象 defaultStatus : 窗口状态栏默认值 status : 窗口状态栏显示信息 navigator : 用于获取浏览器信息 appName "Netscape" for Mozilla "Microsoft Internet Explorer" for IE

  • Window对象方法

    alert() :警告对话框

    confirm() : 确认对话框

    prompt() : 信息输入对话框

    close() : 关闭窗口

    blur() : 窗口失去焦点

    focus() : 窗口获得焦点

    open() : 打开新的窗口,并创建新的window对象

    showModalDialog() : 打开一个模态对话框

    showModelessDialog() : 打开一个非模态对话框

    对话框通过window.dialogArguments来取得传递进来的参数

    对话框通过window.returnValue向打开模态对话框的窗口返回信息,可以返回对象 防止打开新窗口(如提交表单):

  • document对象的属性

    title : 设置文档标题,等价于HTML的标记</p><p>bgColor : 设置页面背景色,对应于<body>中的bgcolor属性</p><p>fgColor : 设置页面前景色,对应于<body>标记中的text属性</p><p>alinkColor : 设置激活链接(焦点在此链接上)的颜色</p><p>linkColor : 设置未点击过的链接颜色</p><p>vlinkColor : 设置已点击过的链接颜色</p><p>URL : 文档的URL forms : 表单对象数组,对应<form>标记</p><p>links : 链接对象数组,对应有href属性的<a href="">标记</p><p>anchors : 锚对象数组,对应有name属性的<a name="">标记</p><p>images : 图片对象数组,对应<img>标记</p></li><li><p>document对象的方法</p><p>close() : 用于关闭当前窗口以外的窗口</p><p>write() : 动态向页面写入内容</p><p>getElementById() : 获得指定ID值的对象</p><p>getElementsByName() :获得指定Name值的对象,返回数组</p><p>getElementsByTagName("tr") : 获得指定TagName的对象,返回数组</p><p>createElement() : 创建指定的HTML标记对象 var obj =createElement("input");</p></li></ul><p><strong>history对象</strong></p><p>属性</p><ul><li><p>current:窗口中当前所显示文档的URL</p></li></ul><p>方法</p><ul><li><p>back():装入历史表中的前一个页面,等效于单击浏览器的返回按钮</p></li><li><p>forward():装入历史表中的下一个页面,等效于单击浏览器上的前进按钮</p></li><li><p>go(string):装入历史表中URL字符串包含这个子串的最近一个文档</p></li><li><p>go(n): n>0时,装入历史表中的往前数第n个文档;n=0时,装入当前文档;n<0时,装入历史表中往后数第n个文档</p></li></ul><p><strong>location 对象</strong></p><p>属性</p><ul><li><p>hash</p></li><li><p>host</p></li><li><p>hostname</p></li><li><p>href</p></li></ul><p>方法</p><ul><li><p>assign(url):将URL直接赋值给location时,JavaScript调用此方法</p></li><li><p>reload():重新加载窗口</p></li><li><p>replace():替换窗口</p></li></ul><p>到此,关于“javascript文档对象模型是什么”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!</p> <br> 文章标题:javascript文档对象模型是什么 <br> 链接分享:<a href="http://www.apyobr.com/article/poccsc.html">http://www.apyobr.com/article/poccsc.html</a> </div> </div> <div class="other"> <h3>其他资讯</h3> <ul> <li> <a href="/article/dcoeipc.html">php获取表中数据总条数 php读取数据表内容</a> </li><li> <a href="/article/dcoeipi.html">腾讯云服务器网络驱动 腾讯云服务器windows怎么用</a> </li><li> <a href="/article/dcoeigo.html">阿里云服务器deepface 阿里云服务器ecs入门考试答案</a> </li><li> <a href="/article/dcoegoe.html">阿里云的云服务器是哪个 阿里云的服务器怎么样</a> </li><li> <a href="/article/dcoeije.html">域名中心全称怎么填写 域名中心全称怎么填写的</a> </li> </ul> </div> </div> <div class="line"></div> <!--底部--> <footer id="5"> <div class="foot1 container"> <div class="list"> <div class="item"> <a href="javascript:;"> <span class="ico1"><i class="iconfont"></i><img src="/Public/Home/img/ewm.png" alt=""></span> <strong>关注我们</strong> </a> </div> <div class="item"> <a href="" target="_blank"> <span><i class="iconfont"></i></span> <strong>索要报价</strong> </a> </div> <div class="item"> <a href="" target="_blank"> <span><i class="iconfont"></i></span> <strong>我要咨询</strong> </a> </div> <div class="item"> <a href="" target="_blank"> <span><i class="iconfont"></i></span> <strong>找到我们</strong> </a> </div> <div class="item"> <a href="" target="_blank"> <span><i class="iconfont"></i></span> <strong>投诉建议</strong> </a> </div> </div> <div class="tel"> <dl> <tel><a href="tel:18982081108" target="_blank">18982081108</a></tel><br> <span>也许您需要专业的服务,欢迎来电咨询</span> </dl> <dl> <tel><a href="tel:18980820575" target="_blank">18980820575</a></tel><br> <span>您的需求,是我们前进的动力</span> </dl> </div> </div> <div class="friend"> <div class="container"> <span class="tit">友情链接:</span> <div class="inner"> <a href="https://www.cdcxhl.com/xiyun.html" target="_blank">西云服务器托管</a><a href="https://www.cdcxhl.com/" target="_blank">网站建设</a><a href="https://www.cdcxhl.com/yunying.html" target="_blank">成都网站托管</a><a href="https://www.cdcxhl.com/mobile.html" target="_blank">成都手机网站制作</a><a href="https://www.cdcxhl.com/mobile.html" target="_blank">手机网站建设</a><a href="https://www.cdcxhl.com/douyin/" target="_blank">抖音运营公司</a><a href="https://www.cdcxhl.com/weihu/" target="_blank">网站维护公司</a><a href="https://www.cdcxhl.com/xiaochengx.html" target="_blank">成都微信小程序开发公司</a><a href="https://www.cdcxhl.com/quanwang.html" target="_blank">全网整合营销推广</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">软文推广</a><a href="https://www.cdcxhl.com/tuoguan/" target="_blank">成都IDC机房托管</a><a href="https://www.cdcxhl.com/mobile.html" target="_blank">成都手机网站建设</a><a href="https://www.cdcxhl.com/tuoguan/" target="_blank">成都服务器托管</a><a href="https://www.cdcxhl.com/gaofang/" target="_blank">高防主机租用</a><a href="https://www.cdcxhl.com/link/" target="_blank">友情链接</a><a href="https://www.cdcxhl.com/wangzhandingzhi.html" target="_blank">成都定制网站网页设计</a><a href="https://www.cdcxhl.com/yunying.html" target="_blank">成都网站托管运营</a><a href="https://www.cdcxhl.com/wangzhandingzhi.html" target="_blank">成都企业网站定制</a> </div> </div> </div> <div class="foot"> <div class="container"> <div class="footNav"> <h3>网站建设</h3> <a href="http://chengdu.cdcxhl.cn/jianshe/" target="_blank">成都网站建设</a><a href="http://www.cqcxhl.com/service/foreigntrade.html" target="_blank">重庆外贸网站建设</a><a href="http://m.cdcxhl.cn/H5/" target="_blank">成都响应式网站建设</a> </div> <div class="footNav"> <h3>服务器托管</h3> <a href="https://www.cdcxhl.com/jigui/" target="_blank">机柜租用</a><a href="http://www.cdxwcx.cn/tuoguan/mianyang.html" target="_blank">绵阳主机托管</a><a href="http://www.cdxwcx.cn/tuoguan/mianyang.html" target="_blank">绵阳服务器托管</a> </div> <div class="footNav"> <h3>网站制作</h3> <a href="http://www.myzitong.com/" target="_blank">梓潼网站制作公司</a><a href="http://chengdu.xwcx.net/mobile/" target="_blank">移动手机网站制作</a><a href="https://www.cdcxhl.com/mobile.html" target="_blank">手机网站制作设计</a> </div> <div class="footNav"> <h3>企业服务</h3> <a href="https://www.cdcxhl.com/shoulu/" target="_blank">分类目录</a><a href="https://www.cdcxhl.com/service/service.html" target="_blank">工商服务</a><a href="https://www.cdcxhl.com/shoulu/" target="_blank">网站快速收录</a> </div> <div class="fr ecode"> <div class="fl"> <img src="/Public/Home/img/ewm.jpg"> <p>关注企业微信</p> </div> <div class="fr slogan"> <p class="icon"> <a class="ph" href=""><i class="iconfont"></i></a> <a class="qq" href="tencent://message/?uin=1683211881&Site=&Menu=yes"><i class="iconfont"></i></a> </p> <p> <i>想要找 </i> <a href="https://www.cdcxhl.com/xiaochengx.html">小程序开发</a>、<a href="https://www.cdcxhl.com/app.html">APP开发</a>、 <a href="https://www.cdcxhl.com/yingxiao.html">营销型网站建设</a>、<a href="https://www.cdxwcx.com/">网站建设</a>、 <i><a href="https://www.cdcxhl.com/wangzhandingzhi.html">网站定制开发</a></i> ,就选<a href="http://www.apyobr.com/">灿优商贸</a> </p> </div> </div> </div> <div class="bottom container"> <p class="fl"> 版权所有:大悟县灿优商贸有限公司 备案号:<a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">鄂ICP备2025125667号-8</a> 服务热线:18982081108 </p> <p class="fr"> <a href="https://www.cdxwcx.com/" target="_blank">成都网站建设</a>: <a href="https://www.cdcxhl.com/" target="_blank">创新互联</a> </p> </div> </div> </footer> <!--在线咨询--> <div class="fot"> <ul> <li> <a href="#" target="_blank"> <img src="/Public/Home/img/fot1.png" alt=""> <p>在线咨询</p> </a> </li> <li> <a href="tel:18980820575" target="_blank"> <img src="/Public/Home/img/fot2.png" alt=""> <p>拨打电话</p> </a> </li> </ul> </div> </body> </html> <script> $(".con img").each(function(){ var src = $(this).attr("src"); //获取图片地址 var str=new RegExp("http"); var result=str.test(src); if(result==false){ var url = "https://www.cdcxhl.com"+src; //绝对路径 $(this).attr("src",url); } }); window.onload=function(){ document.oncontextmenu=function(){ return false; } } </script>