<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>web集结号 &#187; javascript代码</title>
	<atom:link href="http://www.songlecn.com/tag/javascript%e4%bb%a3%e7%a0%81/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.songlecn.com</link>
	<description>专注于web表现层技术</description>
	<lastBuildDate>Wed, 04 Nov 2009 02:46:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Javascript加入收藏夹代码</title>
		<link>http://www.songlecn.com/2009/06/1151/</link>
		<comments>http://www.songlecn.com/2009/06/1151/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 02:12:52 +0000</pubDate>
		<dc:creator>船长</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript代码]]></category>
		<category><![CDATA[加入收藏夹]]></category>

		<guid isPermaLink="false">http://www.songlecn.com/?p=1151</guid>
		<description><![CDATA[Javascript加入收藏夹代码， 这个js代码支持firefox浏览器很是难得， 支持Firefox的加入收藏夹JS代码。 具体信息你可以这么写： 点击即可把你的网站添加到浏览器的收藏菜单下 加入收藏夹 将xxx网站加入收藏夹 收藏本网站 留下网站 怎么写才能让别人加入收藏夹，就要看你的本事了 &#60;script&#62; function addfavorite() { if (document.all) { window.external.addFavorite('http://www.ijavascript.cn',ijavascript.cn');); } else if (window.sidebar) { window.sidebar.addPanel('Dnew.cn', 'http://www.ijavascript.cn', ""); } } &#60;/script&#62; &#60;a href="#" onclick="addfavorite()"&#62;把ijavascript.cn加入收藏&#60;/a&#62; 下面这个也是Javascript加入收藏夹代码,同样支持firefox &#60;script type="text/javascript"&#62; function addBookmark(title,url) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } else if( document.all ) { window.external.AddFavorite( url, title); } else if( [...]]]></description>
		<wfw:commentRss>http://www.songlecn.com/2009/06/1151/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>强制点击广告代码</title>
		<link>http://www.songlecn.com/2009/03/473/</link>
		<comments>http://www.songlecn.com/2009/03/473/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 03:16:55 +0000</pubDate>
		<dc:creator>船长</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript代码]]></category>
		<category><![CDATA[js代码]]></category>
		<category><![CDATA[强制点击广告代码]]></category>

		<guid isPermaLink="false">http://www.songlecn.com/?p=473</guid>
		<description><![CDATA[<script type="text/javascript">
function runcode_open_new(element)
{
	var code = document.getElementById(element).value;
	var win = window.open("", "", "");
	win.opener = null;
	win.document.write(code);
	win.document.close();
}
function runcode_copy(element)
{
	var codeobj = document.getElementById(element);
	var meintext = codeobj.value;
	try {
	 if (window.clipboardData)
	   {
	   window.clipboardData.setData("Text", meintext);
	   }
	   else if (window.netscape)
	   {
	   netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	   var clip = Components.classes['@mozilla.org/widget/clipboard;1']
					 .createInstance(Components.interfaces.nsIClipboard);
	   if (!clip) return;
	   var trans = Components.classes['@mozilla.org/widget/transferable;1']
					  .createInstance(Components.interfaces.nsITransferable);
	   if (!trans) return;
	   trans.addDataFlavor('text/unicode');
	   var str = new Object();
	   var len = new Object();
	   var str = Components.classes["@mozilla.org/supports-string;1"]
					.createInstance(Components.interfaces.nsISupportsString);
	   var copytext=meintext;
	   str.data=copytext;
	   trans.setTransferData("text/unicode",str,copytext.length*2);
	   var clipid=Components.interfaces.nsIClipboard;
	   if (!clip) return false;
	   clip.setData(trans,null,clipid.kGlobalClipboard);
	   }
	} catch (e) {alert('因为安全策略的原因，此项功能已被您的浏览器禁止。关闭此窗口，然后按下“Ctrl+C”组合键完成复制。');		codeobj.focus();
	}
	codeobj.select();
   return false;
}
</script>强制点击广告代码，玩玩就行了，最好别用，会给用户造成很差的体验，反正我是不会用的-。- &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62; &#60;head&#62; &#60;title&#62;强制点击广告代码(一)&#60;/title&#62; &#60;meta http-equiv=&#34;content-type&#34; content=&#34;text/html;charset=gb2312&#34;&#62; &#60;!--把下面代码加到&#60;head&#62;与&#60;/head&#62;之间--&#62; &#60;script language=&#34;javascript&#34;&#62; var num = 2; var mypage = 'http://www.songlecn.com'; var pissoff = '请先点击上面的链接！'; allow = Array(); allow[num] = 2; function gotoit(link){ if (link != num){ allow[link] = 2; } else { for (i=1;i&#60;=num;i++){ if (allow[i] != 2){ [...]]]></description>
		<wfw:commentRss>http://www.songlecn.com/2009/03/473/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>多行文本框如何限制输入字数方法</title>
		<link>http://www.songlecn.com/2009/03/433/</link>
		<comments>http://www.songlecn.com/2009/03/433/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 23:54:19 +0000</pubDate>
		<dc:creator>船长</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript代码]]></category>
		<category><![CDATA[js代码]]></category>
		<category><![CDATA[多行文本框]]></category>
		<category><![CDATA[限制输入字数]]></category>

		<guid isPermaLink="false">http://www.songlecn.com/?p=433</guid>
		<description><![CDATA[<script type="text/javascript">
function runcode_open_new(element)
{
	var code = document.getElementById(element).value;
	var win = window.open("", "", "");
	win.opener = null;
	win.document.write(code);
	win.document.close();
}
function runcode_copy(element)
{
	var codeobj = document.getElementById(element);
	var meintext = codeobj.value;
	try {
	 if (window.clipboardData)
	   {
	   window.clipboardData.setData("Text", meintext);
	   }
	   else if (window.netscape)
	   {
	   netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	   var clip = Components.classes['@mozilla.org/widget/clipboard;1']
					 .createInstance(Components.interfaces.nsIClipboard);
	   if (!clip) return;
	   var trans = Components.classes['@mozilla.org/widget/transferable;1']
					  .createInstance(Components.interfaces.nsITransferable);
	   if (!trans) return;
	   trans.addDataFlavor('text/unicode');
	   var str = new Object();
	   var len = new Object();
	   var str = Components.classes["@mozilla.org/supports-string;1"]
					.createInstance(Components.interfaces.nsISupportsString);
	   var copytext=meintext;
	   str.data=copytext;
	   trans.setTransferData("text/unicode",str,copytext.length*2);
	   var clipid=Components.interfaces.nsIClipboard;
	   if (!clip) return false;
	   clip.setData(trans,null,clipid.kGlobalClipboard);
	   }
	} catch (e) {alert('因为安全策略的原因，此项功能已被您的浏览器禁止。关闭此窗口，然后按下“Ctrl+C”组合键完成复制。');		codeobj.focus();
	}
	codeobj.select();
   return false;
}
</script>多行文本框如何限制输入字数方法，共两种方法，很简单，都是通过js控制的 &#60;textarea id=&#34;a&#34; onpropertychange=&#34;if(this.value.length&#62;10){this.value=this.value.slice(0,10)}&#34;&#62; 提示：你可以先修改部分代码再运行。 &#60;script language=&#34;javascript&#34; type=&#34;text/javascript&#34;&#62; function chkmaxsms(vobj1,vmax) { var str=vobj1.value; var strlen=str.length; if(strlen&#62;vmax) { alert('字数超过限制'); eval(vobj1.value=str.substr(0,vmax)); } } &#60;/script&#62; &#60;textarea name=&#34;textfield&#34; onkeyup=&#34;javascript:chkmaxsms(this,'10')&#34;&#62; 提示：你可以先修改部分代码再运行。]]></description>
		<wfw:commentRss>http://www.songlecn.com/2009/03/433/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>网易的选项卡风格</title>
		<link>http://www.songlecn.com/2009/03/427/</link>
		<comments>http://www.songlecn.com/2009/03/427/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 02:26:53 +0000</pubDate>
		<dc:creator>船长</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript代码]]></category>
		<category><![CDATA[js代码]]></category>
		<category><![CDATA[js特效]]></category>
		<category><![CDATA[网易选项卡]]></category>

		<guid isPermaLink="false">http://www.songlecn.com/?p=427</guid>
		<description><![CDATA[<script type="text/javascript">
function runcode_open_new(element)
{
	var code = document.getElementById(element).value;
	var win = window.open("", "", "");
	win.opener = null;
	win.document.write(code);
	win.document.close();
}
function runcode_copy(element)
{
	var codeobj = document.getElementById(element);
	var meintext = codeobj.value;
	try {
	 if (window.clipboardData)
	   {
	   window.clipboardData.setData("Text", meintext);
	   }
	   else if (window.netscape)
	   {
	   netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	   var clip = Components.classes['@mozilla.org/widget/clipboard;1']
					 .createInstance(Components.interfaces.nsIClipboard);
	   if (!clip) return;
	   var trans = Components.classes['@mozilla.org/widget/transferable;1']
					  .createInstance(Components.interfaces.nsITransferable);
	   if (!trans) return;
	   trans.addDataFlavor('text/unicode');
	   var str = new Object();
	   var len = new Object();
	   var str = Components.classes["@mozilla.org/supports-string;1"]
					.createInstance(Components.interfaces.nsISupportsString);
	   var copytext=meintext;
	   str.data=copytext;
	   trans.setTransferData("text/unicode",str,copytext.length*2);
	   var clipid=Components.interfaces.nsIClipboard;
	   if (!clip) return false;
	   clip.setData(trans,null,clipid.kGlobalClipboard);
	   }
	} catch (e) {alert('因为安全策略的原因，此项功能已被您的浏览器禁止。关闭此窗口，然后按下“Ctrl+C”组合键完成复制。');		codeobj.focus();
	}
	codeobj.select();
   return false;
}
</script>网易的选项卡风格，很简单，就是控制样式和显示罢了，运行查看效果 &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34; xml:lang=&#34;zh-CN&#34; lang=&#34;zh-CN&#34;&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=gb2312&#34; /&#62; &#60;title&#62;网易的选项卡风格-JS特效学院-jsweb8.cn&#60;/title&#62; &#60;style type=&#34;text/css&#34;&#62; &#60;!-- /* 全局CSS定义 */ body { text-align: center; font-family:&#34;宋体&#34;, arial;margin:0; padding:0; background: #FFF; font-size:12px; color:#000;} /* 2列 */ .divArea{margin:0 auto; width:750px;background:url(&#34;http://www.songlecn.com/wp-content/supload/2009/03/05/bg561.gif&#34;);} .divArea .Col1{float:left; width:436px;} .divArea .Col2{float:right; width:300px;} /* 左边选项卡 */ .naTab{clear:both;border-bottom:1px #CCCCCC solid;} [...]]]></description>
		<wfw:commentRss>http://www.songlecn.com/2009/03/427/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>javascript时钟</title>
		<link>http://www.songlecn.com/2009/02/374/</link>
		<comments>http://www.songlecn.com/2009/02/374/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 03:11:54 +0000</pubDate>
		<dc:creator>船长</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript代码]]></category>
		<category><![CDATA[js代码]]></category>
		<category><![CDATA[时钟]]></category>
		<category><![CDATA[显示当前时间]]></category>

		<guid isPermaLink="false">http://www.songlecn.com/?p=374</guid>
		<description><![CDATA[<script type="text/javascript">
function runcode_open_new(element)
{
	var code = document.getElementById(element).value;
	var win = window.open("", "", "");
	win.opener = null;
	win.document.write(code);
	win.document.close();
}
function runcode_copy(element)
{
	var codeobj = document.getElementById(element);
	var meintext = codeobj.value;
	try {
	 if (window.clipboardData)
	   {
	   window.clipboardData.setData("Text", meintext);
	   }
	   else if (window.netscape)
	   {
	   netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	   var clip = Components.classes['@mozilla.org/widget/clipboard;1']
					 .createInstance(Components.interfaces.nsIClipboard);
	   if (!clip) return;
	   var trans = Components.classes['@mozilla.org/widget/transferable;1']
					  .createInstance(Components.interfaces.nsITransferable);
	   if (!trans) return;
	   trans.addDataFlavor('text/unicode');
	   var str = new Object();
	   var len = new Object();
	   var str = Components.classes["@mozilla.org/supports-string;1"]
					.createInstance(Components.interfaces.nsISupportsString);
	   var copytext=meintext;
	   str.data=copytext;
	   trans.setTransferData("text/unicode",str,copytext.length*2);
	   var clipid=Components.interfaces.nsIClipboard;
	   if (!clip) return false;
	   clip.setData(trans,null,clipid.kGlobalClipboard);
	   }
	} catch (e) {alert('因为安全策略的原因，此项功能已被您的浏览器禁止。关闭此窗口，然后按下“Ctrl+C”组合键完成复制。');		codeobj.focus();
	}
	codeobj.select();
   return false;
}
</script>javascript时钟，在你的页面上展现一个时钟指示。运行代码查看效果即可: &#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.0 Transitional//EN&#34;&#62; &#60;html&#62; &#60;head&#62; &#60;title&#62; New Document &#60;/title&#62; &#60;meta name=&#34;Generator&#34; content=&#34;EditPlus&#34;&#62; &#60;meta name=&#34;Author&#34; content=&#34;&#34;&#62; &#60;meta name=&#34;Keywords&#34; content=&#34;&#34;&#62; &#60;meta name=&#34;Description&#34; content=&#34;&#34;&#62; &#60;/head&#62; &#60;body&#62; &#60;form name=&#34;Tick&#34;&#62; &#60;input type=&#34;text&#34; size=&#34;11&#34; name=&#34;Clock&#34;&#62; &#60;/form&#62; &#60;script&#62; function show(){ var Digital=new Date() var hours=Digital.getHours() var minutes=Digital.getMinutes() var seconds=Digital.getSeconds() var dn=&#34;AM&#34; if (hours&#62;12){ dn=&#34;PM&#34; hours=hours-12 } if [...]]]></description>
		<wfw:commentRss>http://www.songlecn.com/2009/02/374/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery实现的文字推荐广告代码</title>
		<link>http://www.songlecn.com/2009/02/270/</link>
		<comments>http://www.songlecn.com/2009/02/270/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 04:01:18 +0000</pubDate>
		<dc:creator>船长</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[CSS+XHTML代码]]></category>
		<category><![CDATA[javascript代码]]></category>
		<category><![CDATA[新闻标题]]></category>

		<guid isPermaLink="false">http://www.songlecn.com/?p=270</guid>
		<description><![CDATA[<script type="text/javascript">
function runcode_open_new(element)
{
	var code = document.getElementById(element).value;
	var win = window.open("", "", "");
	win.opener = null;
	win.document.write(code);
	win.document.close();
}
function runcode_copy(element)
{
	var codeobj = document.getElementById(element);
	var meintext = codeobj.value;
	try {
	 if (window.clipboardData)
	   {
	   window.clipboardData.setData("Text", meintext);
	   }
	   else if (window.netscape)
	   {
	   netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	   var clip = Components.classes['@mozilla.org/widget/clipboard;1']
					 .createInstance(Components.interfaces.nsIClipboard);
	   if (!clip) return;
	   var trans = Components.classes['@mozilla.org/widget/transferable;1']
					  .createInstance(Components.interfaces.nsITransferable);
	   if (!trans) return;
	   trans.addDataFlavor('text/unicode');
	   var str = new Object();
	   var len = new Object();
	   var str = Components.classes["@mozilla.org/supports-string;1"]
					.createInstance(Components.interfaces.nsISupportsString);
	   var copytext=meintext;
	   str.data=copytext;
	   trans.setTransferData("text/unicode",str,copytext.length*2);
	   var clipid=Components.interfaces.nsIClipboard;
	   if (!clip) return false;
	   clip.setData(trans,null,clipid.kGlobalClipboard);
	   }
	} catch (e) {alert('因为安全策略的原因，此项功能已被您的浏览器禁止。关闭此窗口，然后按下“Ctrl+C”组合键完成复制。');		codeobj.focus();
	}
	codeobj.select();
   return false;
}
</script>jquery实现的文字推荐广告代码(js+css)，转自cssrain，个人适当修改注释，方便易懂且容易实现，打开页面后刷新一下就可以看到效果 &#60;html&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62; &#60;title&#62;代码预览&#60;/title&#62; &#60;style&#62; body {FONT-SIZE: 12px; MARGIN: 50px; TEXT-AliGN: center} img {BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px} .news {CLEAR: both; BACKGROUND: url(http://www.songlecn.com/wp-content/supload/2009/02/14/news_bg.gif); WIDTH: 672px; ColOR: #fff; HEIGHT: 26px} .news ul {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; OVERFLOW: hidden; liNE-HEIGHT: 26px; PADDING-TOP: 0px; liST-STYLE-TYPE: none; [...]]]></description>
		<wfw:commentRss>http://www.songlecn.com/2009/02/270/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

