编辑器中可插表情和图片,还能复制网络图片.怎么判断插入的图片不是表情.还有怎么验证<img/>对象中包含width属性. 

解决方案 »

  1.   

    对<IMG/>标签进行分析.看时候能找到WIDTH属性
      

  2.   

    关键当有多个<IMG/>标签时,怎么去把所有的<IMG/>过虑出来.怎么用正则表达式
      

  3.   

     Response.Write("<script>alert('顶一下')</script");
      

  4.   

    Jscript.Alert("这个还真不好搞,关注!");
      

  5.   

    <img src="([^(http://)]+\.[^\"]+)"  
      

  6.   

    当有<img后有"class="或"alt="或"width"怎么用正则表达式取出所有带有width的<img/>标签
      

  7.   

    我写一个
    <img\ssrc="?([\.\w\\ :/]*)"?\s*(width="?([\d\w%]+)"?)?\s*(height="?([\d\w%]+)"?)?\s*(alt="?([\w]*)"?)?(\s*style="?([\w: ;\-%]*)"?)?\s*/?\s*>
    这个可以匹配包含Width,height,alert,style等属性,上述属性可有可无.
      

  8.   

    images = oEditor.EditorDocument.body.getElementsByTagName("img");
    images是你的fckeditor内的所有img标签集合(数组)
    循环他做你的事情,
      

  9.   

    参考
    http://www.cnblogs.com/huobazi/archive/2007/11/02/FckeditorRemoteImageRubber.html
      

  10.   


    用js取值时oEditor缺少对象.
      

  11.   

     搞定了,代码如下:  var oEditor = FCKeditorAPI.GetInstance("FCKeditor1"); 
            var images = oEditor.EditorDocument.body.getElementsByTagName("img"); 
    //        window.event.returnValue=false;
    //        var aa="";
            for(var i=0;i<images.length+1;i++)
            {
            var nwidth=images[i].width;
            var nheight=images[i].height;
             if(nwidth!=null)
             {  if(nheight!=null) 
                {
                if((nwidth>379) && (nheight>258))
                {
                 document.getElementById("imgsrc").value=images[i].src;
                 break;
                } 
                else if((nwidth>300) && (nheight>150))
                {document.getElementById("imgsrc").value=images[i].src;
                 break;}
                }
             }