<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[我是程序员   -Shosh's Blog - 上网技巧]]></title>
<link>http://www.wscxy.com/shosh/</link>
<description><![CDATA[]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog3 v2.8]]></copyright>
<webMaster><![CDATA[shosh.zhu@qisda.com(shosh)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>我是程序员   -Shosh&#39;s Blog</title>
	<url>http://www.wscxy.com/shosh/images/logos.gif</url>
	<link>http://www.wscxy.com/shosh/</link>
	<description>我是程序员   -Shosh&#39;s Blog</description>
</image>

			<item>
			<link>http://www.wscxy.com/shosh/article.asp?id=103</link>
			<title><![CDATA[常用的地址栏js]]></title>
			<author>shosh.zhu@qisda.com(shosh)</author>
			<category><![CDATA[上网技巧]]></category>
			<pubDate>Wed,29 Jul 2009 09:14:42 +0800</pubDate>
			<guid>http://www.wscxy.com/shosh/default.asp?id=103</guid>
		<description><![CDATA[<p>本文贴一些本人感觉比较有用或比较好玩的的一些js代码，这些js代码只要贴到浏览器的地址栏后回车即可，可以完成一些特殊的功能。</p>
<ol>
    <li>查看页面元素的HTML代码：<br />
    <textarea rows="4" cols="80">javascript:document.body.onclick=function(){alert(event.srcElement.outerHTML);return false;};alert(&quot;Shosh:点击页面元素，即可快速浏览其HTML内容了。&quot;)</textarea></li>
    <li>给页面元素加红色框：<br />
    <textarea rows="4" cols="80">javascript:document.body.onclick=function(){event.srcElement.style.border=&quot;solid red 2px&quot;;return false;};alert(&quot;Shosh:点击页面元素，即可将其框起来了。&quot;)</textarea></li>
    <li>去除烦人的alert警告框（注意运行该代码后不会有提示已经成功，但是事实上是已经成功了的）：<br />
    <textarea rows="4" cols="80">javascript:window.alert=function(){};alert(&quot;Shosh:警告框不会再出来了。不过你看不到了：）&quot;)</textarea></li>
    <li>来个好玩的：按住CTRL键，然后移动鼠标掉待缩放的元素上，选中的元素会被绿色虚线框标记出来，然后滚动鼠标滚轮，就可以单独对其缩放了。按住ALT，然后滚动滚轮可取消缩放。<br />
    <textarea rows="4" cols="80">javascript:document.body.onmouseover=function(){if(event.ctrlKey){event.srcElement.style.border=&quot;1px dotted green&quot;;}};document.body.onmouseout=function(){event.srcElement.style.border=&quot;&quot;};document.body.onmousewheel=function(){if(event.ctrlKey){v=(parseInt(event.srcElement.style.zoom,10)||100)-event.wheelDelta/12;if(v&gt;0)event.srcElement.style.zoom=v+&quot;%&quot;;}if(event.altKey){event.srcElement.style.zoom=&quot;100%&quot;;return false;}return true;};alert(&quot;Shosh:按住CTRL,滚动鼠标滚轮，开始缩放之旅吧。&quot;)
    </textarea></li>
    <li>上面的那个有些花哨了，而且没多少实用价值。来个对整个页面作缩放的，使用方法同上。对于整个页面的缩放在使用网页代替ppt给别人做介绍的时候比较有用。<br />
    <textarea rows="4" cols="80">javascript:document.body.onmousewheel=function(){if(event.ctrlKey){v=(parseInt(document.body.style.zoom,10)||100)-event.wheelDelta/12;if(v&gt;0)document.body.style.zoom=v+&quot;%&quot;;}if(event.altKey){document.body.style.zoom=&quot;100%&quot;;return false;}return true;};alert(&quot;Shosh:按住CTRL,滚动鼠标滚轮，开始缩放整个页面之旅吧。&quot;)
    </textarea></li>
    <li>上面的那个方法对于框架网页可能无效，不过我们可以使用另一种方法。请手动修改代码v=&quot;150%&quot;中的数值可以调节缩放比例。<br />
    <textarea rows="4" cols="80">javascript:v=&quot;150%&quot;;document.body.style.zoom=v;alert(&quot;Shosh:页面已缩放至&quot;+document.body.style.zoom+&quot;。&quot;)
    </textarea></li>

    <li>查看页面最后修改时间：（由于动态网页动态生成，所以看到的往往是最新时间）<br />
    <textarea rows="4" cols="80">javascript:alert(&quot;Shosh:本页面最后修改于： "+document.lastModified+" 。&quot;)
    </textarea></li>
</ol>]]></description>
		</item>
		
			<item>
			<link>http://www.wscxy.com/shosh/article.asp?id=38</link>
			<title><![CDATA[终于给Blog的评论添加了回复功能]]></title>
			<author>shosh.zhu@qisda.com(shosh)</author>
			<category><![CDATA[上网技巧]]></category>
			<pubDate>Fri,25 Jul 2008 21:48:08 +0800</pubDate>
			<guid>http://www.wscxy.com/shosh/default.asp?id=38</guid>
		<description><![CDATA[<p>PJBlog的评论没有回复功能，确实是一个遗憾。不过可以看到网上有很多帖子指导大家如何给PJBlog添加评论回复的功能（其实也就寥寥几种方法，只不过被人转来转去而已），发现都需要修改到很多地方。其中有一种需要修改到数据库的方法，只是适合之前的版本，我今天拿来试了下，导致有评论的文章全部出错，无法访问，只好还原文件、还原数据库。</p>
<p>今天下定决心要给Blog添加个回复功能，终于找到了一种简单方便的方法，最少只要添加两行代码（效果请看本站评论有回复的地方）：</p>
<p>打开common目录下的ubbcode.asp，通过搜索关键字&quot;quote&quot;找到下面的代码：</p>
<p>re<font color="#4b0082">.</font>Pattern&nbsp;<font color="#4b0082">=</font>&nbsp;<font color="#800000">&quot;\[quote=(.[^\]]*)\](.*?)\[\/quote\]&quot;</font></p>
<p>在这行代码之前添加以下代码：</p>
<ol id="shoCodeMain326ID" style="border-right: gray 1px solid; padding-right: 2px; border-top: gray 1px solid; padding-left: 2px; padding-bottom: 2px; margin: 0px; border-left: gray 1px solid; color: #2f4f4f; word-break: break-all; padding-top: 2px; border-bottom: gray 1px solid; font-family: Courier New; list-style-type: decimal; background-color: #dcf5dc">
    <li style="padding-left: 6px; margin: 0px 0px 0px 50px; border-left: silver 2px ridge; line-height: 18px; background-color: #f5fffa"><span style="color: black">Rem&nbsp;add&nbsp;by&nbsp;shosh(http://www.wscxy.com)&nbsp;for&nbsp;reply&nbsp;comments</span></li>
    <li style="padding-left: 6px; margin: 0px 0px 0px 50px; border-left: silver 2px ridge; line-height: 18px; background-color: #f5fffa"><span style="color: black">re.Pattern&nbsp;=&nbsp;&quot;\[quote=wscxyAnswerComment\](.*?)\[\/quote\]&quot;</span></li>
    <li style="padding-left: 6px; margin: 0px 0px 0px 50px; border-left: silver 2px ridge; line-height: 18px; background-color: #f5fffa"><span style="color: black">strContent&nbsp;=&nbsp;re.Replace(strContent,&nbsp;&quot;&lt;div&nbsp;class=&quot;&quot;UBBPanel&quot;&quot;&nbsp;id=&quot;&quot;wscxyReplyPanel&quot;&quot;&gt;&lt;div&nbsp;class=&quot;&quot;UBBTitle&quot;&quot;&nbsp;id=&quot;&quot;wscxyReplyTitle&quot;&quot;&gt;&lt;img&nbsp;src=&quot;&quot;images/quote.gif&quot;&quot;&nbsp;style=&quot;&quot;margin:0px&nbsp;2px&nbsp;-3px&nbsp;0px&quot;&quot;&nbsp;alt=&quot;&quot;Replied&nbsp;by&nbsp;the&nbsp;administrator&nbsp;of&nbsp;the&nbsp;blog.&quot;&quot;/&gt;&nbsp;博主回复：&lt;/div&gt;&lt;div&nbsp;class=&quot;&quot;UBBContent&quot;&quot;&nbsp;id=&quot;&quot;wscxyReplyContent&quot;&quot;&gt;$1&lt;/div&gt;&lt;/div&gt;&quot;)&nbsp;</span></li>
</ol>
<p>OK，这样就已经搞定了，之后你就可以登陆后台在评论管理中直接在评论的后面添加类似下面的代码就可以了：</p>
<p>[quote=wscxyAnswerComment]这里填写回复的内容。[/quote]</p>
<p>另外目前这样做，回复和样式和引用的样式一样，这里添加了一个ID，为的就是方便修改样式，可以在每个article页面都能够引用到CSS的地方添加下面的样式设置代码（自己修改样式，ID设置对了就好）：</p>
<OL id=shoCodeMain55ID style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 0px; BORDER-LEFT: gray 1px solid; COLOR: #2f4f4f; WORD-BREAK: break-all; PADDING-TOP: 2px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: Courier New; LIST-STYLE-TYPE: decimal; BACKGROUND-COLOR: #dcf5dc">
<LI style="PADDING-LEFT: 6px; MARGIN: 0px 0px 0px 50px; BORDER-LEFT: silver 2px ridge; LINE-HEIGHT: 18px; BACKGROUND-COLOR: #f5fffa"><SPAN style="COLOR: black"><FONT color=green>/*当然根据你自己的需要增删修改了*/</FONT>&nbsp;</SPAN></LI>
<LI style="PADDING-LEFT: 6px; MARGIN: 0px 0px 0px 50px; BORDER-LEFT: silver 2px ridge; LINE-HEIGHT: 18px; BACKGROUND-COLOR: #f5fffa"><SPAN style="COLOR: black">#wscxyReplyPanel<FONT color=#4b0082><B>{</B></FONT><FONT color=#4b0082><B>}</B></FONT>&nbsp;</SPAN></LI>
<LI style="PADDING-LEFT: 6px; MARGIN: 0px 0px 0px 50px; BORDER-LEFT: silver 2px ridge; LINE-HEIGHT: 18px; BACKGROUND-COLOR: #f5fffa"><SPAN style="COLOR: black">#wscxyReplyTitle<FONT color=#4b0082><B>{</B></FONT><FONT color=blue>font-weight</FONT><FONT color=red>:</FONT><FONT color=#800000>bold</FONT><FONT color=red>;</FONT><FONT color=blue>color</FONT><FONT color=red>:</FONT><FONT color=#800000>red</FONT><FONT color=red>;</FONT><FONT color=#4b0082><B>}</B></FONT>&nbsp;</SPAN></LI>
<LI style="PADDING-LEFT: 6px; MARGIN: 0px 0px 0px 50px; BORDER-LEFT: silver 2px ridge; LINE-HEIGHT: 18px; BACKGROUND-COLOR: #f5fffa"><SPAN style="COLOR: black">#wscxyReplyContent<FONT color=#4b0082><B>{</B></FONT><FONT color=blue>color</FONT><FONT color=red>:</FONT><FONT color=#800000>green</FONT><FONT color=red>;</FONT><FONT color=#4b0082><B>}</B></FONT>&nbsp;&nbsp;&nbsp;</SPAN></LI></OL><p>你甚至把左上角的图片都换成你自己的哦~</p>
<p>另外，需要告诉大家的是，这样做在评论预览中还看不到UBB代码，这才是此方法相对其他方法更胜一筹的地方哦。</p>]]></description>
		</item>
		
			<item>
			<link>http://www.wscxy.com/shosh/article.asp?id=20</link>
			<title><![CDATA[保存网页小技巧]]></title>
			<author>shosh.zhu@qisda.com(shosh)</author>
			<category><![CDATA[上网技巧]]></category>
			<pubDate>Tue,24 Jun 2008 23:07:39 +0800</pubDate>
			<guid>http://www.wscxy.com/shosh/default.asp?id=20</guid>
		<description><![CDATA[先说最基本最简单的：<br/><br/>1、如果只是要保存一段文字，只需要复制粘贴再保存即可。<br/><br/>2、不过有的网页比较变态，使用js代码［什么是js代码？全称JavaScript，是一种解释性执行的脚本，被广泛应用于网页。它的代码被浏览器下载到本地后再被解释执行。想学习网页制作的朋友以后肯定会和它亲密接触的哦！］使页面的内容不允许被选中或复制了。一种方法是查看源文件，然后找到相应的代码再保存即可。当然浏览器的地址栏除了输入网址访问网页外，还有其他很多功能，比如可以执行特定的js代码，可以让网页中不许选中复制的代码覆盖掉（禁用js的执行也是一种不错的方法哦）。这个以后再说。<br/><br/>3、这个应该是大家用的最多的方法，就是将整个网页保存下来，使用[文件]菜单下的[另存为……]功能，保存类型使用html。不过有的网页不能够这样保存，因为制作者在页面代码中加了诸如&lt;iframe src=&#34;*.htm&#34;&gt;&lt;/iframe&gt;的代码。对于页面中添加了这样的代码的页面，也是有办法使用该方法保存的，只是稍微麻烦点，不过还好，不需要其他辅助工具。方法如下：<br/><br/>先查看该网页的源代码，然后在&lt;head&gt;之后加入以下代码：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code37968);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.wscxy.com/shosh/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code37968>&lt;base href=&#34;网页的目录路径&#34;&gt;&lt;/base&gt;</div></div><br/>比如当前查看的网页为<a href="http://www.wscxy.com/<a href="http://www.wscxy.com" target="_blank">shosh</a>/default.asp?id=6" target="_blank" rel="external">http://www.wscxy.com/<a href="http://www.wscxy.com" target="_blank">shosh</a>/default.asp?id=6</a>, 那就是下面的代码：<div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code29682);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.wscxy.com/shosh/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code29682>&lt;base href=&#34;<a href="http://www.wscxy.com/<a href="http://www.wscxy.com" target="_blank">shosh</a>/" target="_blank" rel="external">http://www.wscxy.com/<a href="http://www.wscxy.com" target="_blank">shosh</a>/</a>&#34;&gt;&lt;/base&gt;</div></div><br/>然后找到作者加的那句防止网页被另存为的代码并将其删除，然后将你修改好的源代码以.htm扩展名另存为网页，之后再将其用浏览器打开，在使用另存为网页功能，这个时候就可以保存了，并且可以同时将网页中用到的其他资源文件一同保存下来，放在“网页名.files&#34;目录中。<br/><br/>4、使用上面第3种保存一般主要目的是为了方便保存网页中的所有资源文件，如图片、js文件等。而如果只是想把页面的内容保存下来而不时获取各种资源文件的话，这种方法就有缺陷了。因为直接另存为网页会同时将页面上其他可以保存的资源文件保存下来，放在“网页名.files&#34;的目录中。大多数网页都会有几十张图片，所以保存下来的文件会有很多，很臃肿不易维护。这时，就可以另存为单一网页文件（.mht），这样保存下来的网页只有一个mht文件，而且双击该文件后可以仍然可以看到图文并茂的网页。这是因为它能够把网页中用到的其他资源文件（如图片、js、css等）同时保存到该mht文件中。双击mht文件使用浏览器打开（再查看源文件）和你使用记事本打开该文件看到的内容是不一样的。或许你会奇怪，mht保存了图片等非字符文件，怎么还能够用记事本打开看懂呢？这时因为保存图片等文件的时候，它会对图片的数据进行编码（最常用的方法是base64编码），这样那些完全无法看懂的二进制数据就被编码成了可以看懂的字符，只不过，你完全没有必要去研究这些可以看懂的字符有什么样的含义，只要知道可以通过base64的解密方法还原成原来的图片数据就可以了。之所以这样做，是为了保存更方便（不然就没法使用ASCII码保存了，如果不使用ASCII码保存文件而使用Unicode或utf-8或其他非单字节编码保存文件的话，文件会变得庞大）。<br/><br/>不过浏览器自带的保存mht文件的功能比较弱，有些特殊的页面保存的效果不理想甚至没法保存，这时候你可以去网上搜索一款保存mht文件的软件来用。这些软件往往比浏览器自带的要强很多。<br/><br/>先写到这里了，以后有时间再补充……]]></description>
		</item>
		
</channel>
</rss>
