getElementById

<script>
function ctf(id){
var temp=document.getElementById(id);//找到input1
temp.innerHTML="我的内容被改变"; //直接改边名为 id 的div的内容
}
</script>

<DIV ID="input1"><b>我是第一</b></div>
<DIV ID="input2"><b>我是第二</b></div>

<a href="#" onclick="ctf('input1')"> 改变一</a>
<a href="#" onclick="ctf('input2')"> 改变二</a>

FCKeditor For Java/Jsp

1.下载
FCKeditor.java 2.3/FCKeditor-2.3.zip (FCKeditor for java)
FCKeditor_2.3b.zip (FCKeditor基本文件)

2.建立项目:Project/FCKeditor

3.FCKeditor.java  FCKeditor-2.3.zip解压后,把其中的web目录下的WEB-INF目录copy到FCKeditor下(里面有commons-fileupload.jar, FCKeditor-2.3.jar,web.xml等几个文件), 把其中的src目录下的FCKeditor.tld文件copy到FCKeitor/WEB-INF/下


4.修改web.xml:
把SimpleUploader中的配置属性enabled定义为true(开启文件上传功能),加上editor所在目录, 下面红色是增加的部分
<servlet-mapping>
    <servlet-name>Connector</servlet-name>
    <url-
pattern>/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector</url-
pattern>
  </servlet-mapping>
  
  <servlet-mapping>
    <servlet-name>SimpleUploader</servlet-name>
    <url-pattern>/FCKeditor/editor/filemanager/upload/simpleuploader</url-pattern>
  </servlet-mapping>

添加标签定义:
<taglib>
<taglib-uri>/FCKeditor</taglib-uri>
<taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>
</taglib>


5.解压FCKeditor_2.3b.zip后,把目录/editor和fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml四个文件copy到/FCKeditor下
删除目录/editor/_source,
删除/editor/filemanager/browser/default/connectors/下的除了test.html外的所有文件夹
删除/editor/filemanager/upload/下除了test.html外的所有文件夹
删除/editor/lang/下的除了en.js, zh.js, zh-cn.js三个文件外的所有文件

6.打开/FCKeditor/fckconfig.js
修改 FCKConfig.DefaultLanguage = 'zh-cn' ;
把FCKConfig.LinkBrowserURL等的值替换成以下内容:
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" ;

FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" ;

FCKConfig.FlashBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" ;

FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=File' ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Image' ;
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Flash' ;


7.三种方法调用FCKeditor
(1).FCKeditor自定义标签 (必须加头文件 <%@ taglib uri="/FCKeditor" prefix="FCK" %> )
显示
<form action="show.jsp" method="post" target="_blank">
<FCK:editor id="content" basePath="/FCKeditor/" width="700" height="500" skinPath="/FCKeditor/editor/skins/silver/"
   toolbarSet = "Default" >
input
</FCK:editor>
<input type="submit" value="Submit">
</form>

(2).script脚本语言调用 (必须引用 脚本文件 <script type="text/javascript" src="/FCKeditor/fckeditor.js"></script> )
显示
<form action="show.jsp" method="post" target="_blank">
<table border="0" width="700"><tr><td>
<textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px">input</textarea>
<script type="text/javascript">
var oFCKeditor = new FCKeditor('content') ;
oFCKeditor.BasePath = "/FCKeditor/" ;
oFCKeditor.Height = 400;
oFCKeditor.ToolbarSet = "Default" ;
oFCKeditor.ReplaceTextarea();
</script>
<input type="submit" value="Submit">
</td></tr></table>
</form>

(3).FCKeditor API 调用 (必须加头文件 <%@ page language="java" import="com.fredck.FCKeditor.*" %> )
<form action="show.jsp" method="post" target="_blank">
<%
FCKeditor oFCKeditor ;
oFCKeditor = new FCKeditor( request, "content" ) ;
oFCKeditor.setBasePath( "/FCKeditor/" ) ;
oFCKeditor.setValue( "input" );
out.println( oFCKeditor.create() ) ;
%>
<br>
<input type="submit" value="Submit">
</form>


8.输出:
<%
String content = request.getParameter("content");
out.print(content);
%>


ok!

另:FCKeditor for Java的上传是通过servlet进行的,不是Jsp,所以配置文件web.xml中的"editor/filemanager/browser/default/connectors/jsp/connector"  jsp/connector 目录并不存在,只要配置好FCKeditor.java就行了,最后上传非常快

IIS URLRewrite 匹配任何字符

{[^/<>=()'";:.^]+} 或 ([^/<>=()'";:.^]+)

包括中文在内,除了"/"  "" ">" "<" "=" "(" ")" ";" ":" "."  这10个特殊字符外其他一律匹配

 

自动跳转到https:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
                </rule>
 
            </rules>
        </rewrite>
        <httpProtocol>
            <customHeaders>
                <add name="Strict-Transport-Security" value="max-age=31536000; includeSubdomains; preload" />
            </customHeaders>
        </httpProtocol>
                    
    </system.webServer>
</configuration>
 

偶然发现

“也许你永远都不会知道一个朋友在遥远的地方祝福你快乐幸福,”
多年之后,还有挚友在远方默默的为你祝福,这份感情是真挚而又难得的,看到这篇文章,不免有几分憧憬,遥想高中几年,那时年少、单纯而又带着几分傻气的拼搏造就了许多美好而又模糊的回忆,也许某一天,我会找回像六年前那样的能量去维持下一个旅程,邸天峰、周希霞、刘凤鹃,当年的好朋友们,你们都在哪里?

谢谢希霞的祝福。

Link:微笑着记起

作品集:http://www.enjoybar.com/member/enjoybar.asp?UserName=Rea

盗链是魔鬼`

近日流量猛赠,BLOG打开速度明显慢了好多,分析了下来源,原来是有好心人转载了不少图片和链接,放到些人气很高的forum,把小blog拖慢了。带宽有限,盗链是魔鬼,只能定期修改链接,希望匿名人士随手复制时把资源下到本地,也不要忘注名出处,那样就非常感激了。