My Desktop :) 桌面式代碼
更新時間:2008年12月29日 20:28:16 作者:
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.fzitv.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>
相關文章
JavaScript實現(xiàn)環(huán)繞鼠標旋轉(zhuǎn)效果
這篇文章主要為大家詳細介紹了JavaScript實現(xiàn)環(huán)繞鼠標旋轉(zhuǎn)效果,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-01-01
JavaScript標準對象_動力節(jié)點Java學院整理
這篇文章主要為大家詳細介紹了JavaScript標準對象的相關資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-06-06
增強的 JavaScript 的 trim 函數(shù)的代碼
增強的 JavaScript 的 trim 函數(shù)的代碼...2007-08-08
爬蟲進階-JS自動渲染之Scrapy_splash組件的使用
Splash是一個Javascript渲染服務。它是一個實現(xiàn)了HTTP API的輕量級瀏覽器,Splash是用Python和Lua語言實現(xiàn)的,基于Twisted和QT等模塊構建,今天重點給大家介紹js Scrapy_splash組件使用教程,一起看看吧2021-09-09
詳解JavaScript中Math內(nèi)置對象基本方法的使用
Math?是javaScript的內(nèi)置對象,包含了部分數(shù)學常數(shù)屬性和數(shù)學函數(shù)方法。本文將詳細講解Math基本方法的使用,感興趣的小伙伴可以學習一下2022-04-04

