当前位置: 首页 > 图文教程 > 网络编程 > Javascript > My Desktop :) 桌面式代码

Javascript
RDF:Web数据集成的元数据解决方案
你的IP
弹出精彩-弹出式菜单详解
在Web网页上使用VBScript 和JScript
图档结构树的设计与关联
JavaScript电子表
输入日期之改进模式
如果你想打开一个新页面时给浏览者一些惊喜的话,试试这个
HTML文档中用JavaScript调用Microsoft Agent的COM接口编程
JavaScript修改注册表
JavaScript构造XML树结构
一个很不错的主页效果。。你试试!!!
一个用js加密的好玩的东东
在网页上显示一个会移动的透明时钟的代码。。。
如何显示年月日及星期问题
javascript手冊-c
javascript手冊-d
javascript手冊-f
javascript手冊-g
javascript手冊-i

Javascript 中的 My Desktop :) 桌面式代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 161 ::
收藏到网摘: n/a

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('http://www.ruanchen.com')">ruanchen.com</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>