Menu

Img tag with javascripts

Help
wxredstar
2008-12-29
2013-04-27
  • wxredstar

    wxredstar - 2008-12-29

    Dear all,
        I wish remove <Img> tag in html. I found if the tag like
    <IMG alt="" src="/oldweb/uploadfile/2007930144216542.jpg" onload="javascript:if(this.width>screen.width-333)this.width=screen.width-333" border=0>
    It doesn't work well, the result is
    screen.width-333)this.width=screen.width-333" border=0>
    How can I make htmlparser deal with the end of <Img> tag correctly?
    Thanks!
    Best Regards,
    Wxredstar

     
    • Derrick Oswald

      Derrick Oswald - 2008-12-29

      This is incorrect script because of the 'greater-than' sign in the quoted constant.

      Try setting the static member:
        org.htmlparser.scanners.ScriptScanner.STRICT = false;

       
    • wxredstar

      wxredstar - 2009-01-06

      Thanks for reply!
      static member org.htmlparser.scanners.ScriptScanner.STRICT  has already been set to false. I think htmlparser can only recognize <scripts></scripts> tag but scripts in "onload" method.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.