如何检查链接的存在?

编程入门 行业动态 更新时间:2024-10-26 06:28:07
本文介绍了如何检查链接的存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

作为标题,如何在javascript中进行ckecking? 谢谢!

解决方案

Cylix写道:

作为标题,如何在javascript中进行ckecking? 谢谢!

var links = document.links; for(var i = 0; i< links.length; i ++) { //点击此处查看具体链接 // //示例: // if(links [i]!= null) // { // alert(链接存在:)); //休息; //} }

marss写道2007年2月1日在comp.lang.javascript

> Cylix写道:

>作为标题,如何在javascript中进行ckecking?谢谢!

var links = document.links; for(var i = 0; i< links.length; i ++) { //点击此处查看具体链接 // //示例: // if(links [i]!= null) // { // alert(链接存在:)); //休息; //} }

我认为OP想要在线测试网站的存在。 测试你知道应该在那里的图像。 < img src = ''iacnn/cnn/2007/WORLD/europe/02/01/blair.police/t1.blair.ap.jp g'' onload =''alert(" cnn found")'' onerror =''alert(" cnn not found")''

>

- Evertjan。 荷兰。 (请更改在我的电子邮件地址中的点数x)来自

" Evertjan。 < ex ************** @ interxnlwrote in message news:Xn **************** **** @ 194.109.133.242 ...

marss于2007年1月1日在comp.lang.javascript中写道

>> Cylix写道:

>>作为标题,如何用javascript做ckecking?谢谢!

var links = document.links; for(var i = 0; i< links.length; i ++) // //点击此处查看具体链接 // //示例: // if(links [i]!= null) // { // alert( 存在一个链接:)"); // break; //} }

我认为OP想要在线测试网站的存在。 测试你知道的图像应该在那里。 < img src = ''iacnn/cnn/2007/WORLD/europe/02/01/blair.police/t1.blair.ap.jp g'' onload =''alert(" cnn found")'' onerror =''alert(" cnn not found" ;)''

你以格式化标记的方式杀了我。 (不错!) 哦,顺便说一下,JSWorld不再是一个JavaScript网站了。 -Lost

As the title, How to do the ckecking in javascript? Thanks!

解决方案

Cylix wrote:

As the title, How to do the ckecking in javascript? Thanks!

var links = document.links; for(var i = 0; i < links.length; i++) { //check here for specific link // //Example: //if (links[i] != null) //{ // alert("A link exists :)"); // break; //} }

marss wrote on 01 feb 2007 in comp.lang.javascript:

> Cylix wrote:

>As the title, How to do the ckecking in javascript?Thanks!

var links = document.links; for(var i = 0; i < links.length; i++) { //check here for specific link // //Example: //if (links[i] != null) //{ // alert("A link exists :)"); // break; //}}

I think that the OP wants to test the existence of a website on line. Test for an image you know should be there. <img src= ''i.an/cnn/2007/WORLD/europe/02/01/blair.police/t1.blair.ap.jp g'' onload=''alert("cnn found")'' onerror=''alert("cnn NOT found")''

>

-- Evertjan. The Netherlands. (Please change the x''es to dots in my emailaddress)

"Evertjan." <ex**************@interxnlwrote in message news:Xn********************@194.109.133.242...

marss wrote on 01 feb 2007 in comp.lang.javascript:

>>Cylix wrote:

>>As the title, How to do the ckecking in javascript?Thanks!

var links = document.links;for(var i = 0; i < links.length; i++){ //check here for specific link // //Example: //if (links[i] != null) //{ // alert("A link exists :)"); // break; //}}

I think that the OP wants to test the existence of a website on line. Test for an image you know should be there. <img src= ''i.an/cnn/2007/WORLD/europe/02/01/blair.police/t1.blair.ap.jp g'' onload=''alert("cnn found")'' onerror=''alert("cnn NOT found")''

You kill me the way you format your markup. (Not a bad thing!) Oh and by the way, JSWorld is not a JavaScript site anymore. -Lost

更多推荐

如何检查链接的存在?

本文发布于:2023-11-10 03:02:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574167.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:链接

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!