Community
Participate
Working Groups
Build Identifier: 20110615-0604 When writing a "return" statement in a "on..." (onclick, for example) tag attribute, HTML & JSP validation incorrectly flags it with the message "cannot return from outside function or method". Reproducible: Always Steps to Reproduce: 1. Create an HTML or JSP file and open if with either with "Web Page Editor" or "HTML Editor/JSP Editor" (preferably the later). 2. Write the following content: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript"> function foo() { return false; } </script> </head> <body> <button onfocus="return foo()">Push!!!</button> </body> </html> 3. Save the file. 4. If the error does not shows up, right click the file into the project tree and select "Validate". ("Web Page Editor" doesn't show the error until you do so).
*** Bug 353198 has been marked as a duplicate of this bug. ***
I think this is a regression of WTP 3.3.0, because I don't remember I saw it in 3.2.x. The problem is still present in WTP 3.3.1.
(In reply to comment #2) > I think this is a regression of WTP 3.3.0, because I don't remember I saw it in > 3.2.x. No, I can reproduce this with the latest 3.2.5 I-build.
Still present in the latest WTP build: Version: 3.3.0.v201103310011-7H7EFZ-DxumTla66ahfUnHfpsz0u5Z92pU4TxSL Build id: 20110513100703
If the error does not shows up.... But the error still exists,how should I do?
I'm still seeing it with code like onclick="popupwindow('help.html'); return false;" I've got over 100 of these, which means javascript validation is completely useless. Until this is fixed, Eclipse doesn't have javascript validation. Please consider increasing the severity of this bug. Eclipse Java EE IDE for Web Developers. Version: Indigo Service Release 1 Build id: 20110916-0149 JavaScript Development Tools Version: 1.3.1.v201108102009-7F78FXRFBBoPbXRPcHfz-uy Build id: 20110915193224
Please, someone, do something about it! I am already unhappy with unnecessary warnings. They are sometimes difficult to get rid of. I am not happy when my "problems" window isn't empty. Now when the IDE give me ERRORs, it drives me nuts. I have to disable JSP validation completely else I cannot concentrate on real errors and real warnings. I don't see why it should be so difficult to get rid of that particular warning. It should be just a few lines to comment out. Else, could you please move that warning to a category that I can disable? Thanks.
I have the same problem, for example in lines like (in jsp): "onkeypress="return checkFilter(event);" Eclipse Java EE IDE for Web Developers. Version: Indigo Service Release 1 Build id: 20110916-0149 JavaScript Development Tools Version: 1.3.1.v201108102009-7F78FXRFBBoPbXRPcHfz-uy Build id: 20110915193224
Please retry with Juno.
Seems to work for me under Juno (Linux x86_64) Thanks so much!!!! :-)
Seems working in WTP 3.4.0 (both Eclipse 3.8 and 4.2).
It's working in June also for me :)
.