<iframe frameborder="1" name="kkk" height="100" width="100" src="about:blank"></iframe>
<button onClick="show()">show</button>
<input name="url" type="text">
<button onClick="goUrl()">go</button>
<script>
function goUrl(){
document.all.tags("iframe")[0].src = url.value
}
function show(){
showIt = kkk.document.title
if( showIt == "找不到服务器" || showIt == "无法找到网页"){
alert(showIt)
}
}
</script>
<button onClick="show()">show</button>
<input name="url" type="text">
<button onClick="goUrl()">go</button>
<script>
function goUrl(){
document.all.tags("iframe")[0].src = url.value
}
function show(){
showIt = kkk.document.title
if( showIt == "找不到服务器" || showIt == "无法找到网页"){
alert(showIt)
}
}
</script>
解决方案 »
- 新闻发布系统中,如何把评论和相应的新闻关联起来?
- 关于JavaScript的问题
- js报错,报方法未找到
- javascript与html(菜鸟请进)
- jqgrid 分页
- 这个正则表达式怎么写?
- 有没有办法让textarea有类似width="100%"的效果。
- document.all 和document.layer 到底是什么意思?
- 求助关于ES6问题,items.filter(item => typeof item === type)这句怎么理解?item哪里来的?()括号内怎么理解?
- 【angular】通过按钮事件关闭网页
- 如何用变量代替对象名字
- window.open 中 URL 的最大长度问题
function getURL(url)
{
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
if (xmlhttp.readyState==4)
alert((xmlhttp.Status==200)?"存在":"不存在");
}
//user like this:
getURL("http://localhost/1.asp");
</script><a href="http://www.csdn.net/" onclick="getURL(this.href)">mm</a>