posts - 32,  comments - 3,  trackbacks - 0
          //首先在HEAD區加入要引用的JS
          <head>
          <script type="text/javascript" src="FCKEditor/fckeditor.js"></script> 
          <script type="text/javascript" language="javascript">
          function check()
          {
             // 取得FCKEditor的值,GetInstance(arg),這里的參數arg是FCKeditor實例名;
             //如聲明FCKeditor用var oFCKeditor = new FCKeditor('FCKEditor1',500,200,'Board'),則此時arg就是FCKEditor1;
                  var checkContent1 =FCKeditorAPI.GetInstance("FCKEditor1").GetXHTML();
                  if (checkContent1 == "")
                  {
                     strErr += '評論內容不能為空!\n\n';
              alert(strErr);
                  }
          }
          </script>
          </head>
          <%-- 把這段寫在需要顯示FCKEditor編輯框的地方 --%>
          <div class="FCKeditor">
          <script type="text/javascript">
              var sBasePath = "FCKEditor/";
              var oFCKeditor = new FCKeditor('FCKEditor1',500,200,'Board'); //實例名為FCKEditor1
              oFCKeditor.BasePath = sBasePath ;
              oFCKeditor.Create() ;
          </script>
          </div>
          <%-- 用于提交內容的按鈕,響應點擊事件為 check() --%>
          <input id="Button1" value="button" type="button" onclick="check()" />
          轉自:http://hi.baidu.com/myaspdotnet/blog/item/0b73cd3f0ab9f3c77c1e714a.html
          posted on 2011-05-27 22:21 donghang73 閱讀(231) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 兰坪| 和平县| 屏东市| 新蔡县| 榆林市| 荥阳市| 饶河县| 鹤山市| 锡林郭勒盟| 正镶白旗| 潞西市| 辽宁省| 平湖市| 电白县| 揭阳市| 尼木县| 中江县| 双牌县| 汶上县| 黄梅县| 化州市| 乐平市| 济宁市| 赤壁市| 故城县| 南溪县| 平度市| 河东区| 永善县| 哈尔滨市| 股票| 大冶市| 阿拉善盟| 高州市| 唐山市| 青阳县| 清新县| 亚东县| 乌拉特前旗| 祁阳县| 丘北县|