帮助你我他,遇到网站问题怎么办:找它帮你网
当前位置:主页 > Web前端技术 > JavaScript基础 >

技术牛人说明My Desktop :) 桌面式代码

时间:2022-01-21 03:32:34|来源:网络精心整理

这篇文章主要讲解的是My Desktop :) 桌面式代码,文章内容非常详细,相信一定可以解决你的问题,需要的朋友可以参考下哦

复制代码 代码如下:

<body bgcolor="black">
<script language = "javascript">
function loadframe(url)
{
mainone.innerHTML = "<iframe src='" + url + "' width='100%' height='500'></iframe>";
}

function loadframefrominput(url)
{
var tmpstr;
tmpstr = url.value;
try{
if(tmpstr==""||tmpstr=="http://"||tmpstr=="https://"||tmpstr=="ftp://")
mainone.innerHTML = "Please enter URL.";
else if(tmpstr.indexOf("http://")>=0||tmpstr.indexOf("https://")>=0||tmpstr.indexOf("ftp://")>=0)
mainone.innerHTML = "<iframe src='" + tmpstr + "' width='100%' height='500'></iframe>";
else
mainone.innerHTML = "Please enter a valid URL.";
}catch(err)
{
mainone.innerHTML = err.description;
}
}

function contain(str,charset)
{
var i;
for(i=0;i<charset.length;i++)
if(str.indexOf(charset.charAt(i))>=0)
return true;
return false;
}

function clearframe()
{
mainone.innerHTML = "";
}

</script>
<font color=white>
<table border="0" width="1000" align=center>
<p>
<hr/>
<button onclick="loadframe('http://rss.news.sohu.com/rss/guoji.xml')">Sohu Int.</button>
<button onclick="loadframe('http://rss.news.sohu.com/rss/it.xml')">Sohu IT</button>
<button onclick="loadframe('http://rss.news.sohu.com/rss/guonei.xml')">Sohu Nat.</button>
<button onclick="loadframe('//www.jb51.net')">jb51.net</button>
<button onclick="loadframe('http://www.baidu.com')">baidu</button>
<button onclick="loadframe('http://www.google.com')">Google</button>
<button onclick="clearframe()">Close</button>
Open a URL: <input id="urltxt" size="50" value="http://"/> <button onclick="loadframefrominput(urltxt)"> Go! </button>
<hr/>
<div id="mainone" width="100%" hight="500"></div>
</table>



</font>
</body>

上一篇:站长介绍js 提取class相同的节点集合

下一篇:小编介绍Javascript typeof 用法

本文标题:技术牛人说明My Desktop :) 桌面式代码

本文地址:https://www.tabangni.com/jsstudy/48713.html

查看更多与“myDesktop”有关的文章



重要申明:本站所有的文章均收集自网络,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

Copyright © 2017-2021 它帮你网 版权所有 豫ICP备17031272号-3