你这个挺麻烦的说。
如果是只有onload里有js的话那么就把onload去掉。不就可以啦?

解决方案 »

  1.   

    JS到没有关系 关键是style="WIDTH: 550px;  或者width=550 这样的 这么以来
     var cc = document.getElementById("aa");
     if(cc!=null)
     {
     var images = cc.getElementsByTagName("img");
     for(i=0;i<images.length;i++)
     {
       if(images[i].width>200)
       {
               images[i].width=200;
    这个就不顶用了    
       }
       
     }
      

  2.   

    如果不考虑JS的话可以用正则替换掉style里的内容
      

  3.   

    如果现在要过滤掉<div id=aa></div> 里的所有>200的width的属性,包括style 和width=这两种形式,这个怎么写啊  汗。。
      

  4.   

    就把所有width="200" 或者style中width : 200 只要是这样超过200的全过滤掉
      

  5.   

    <script type="text/javascript">
    function wc(a, b, c, d, e, f) {
    if (c) {
    if (parseInt(c) > 200)
    return "width=" + b + 200 + b;
    else
    return a;
    } else {
    if (parseInt(e) > 200)
    return d + 200 + f;
    else
    return a;
    }
    }
    var strng = '<div style="width:2001px;" width="2001"></div>';
    var p = /width=([\"']?)(\d+)\1|(style=\"[^\"]*?width:)(\d+)([^\"]*\")/gi;
    var j = strng.replace(p, wc);
    alert(j);
    //好麻烦的说。。
    </script>
      

  6.   

    function wc(a, b, c, d, e, f) {
    if (parseInt(c || e) > 200) {
    if (c)
    return "width=" + b + 200 + b;
    else
    return d + 200 + f;
    } else return a;
    }