facebook

HTML Tag and JavaScript Issues Within The Editor

πŸ’‘
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #202396 Reply

    Don
    Member

    I am currently evaluating MyEclipse and have found it to be excellent.

    After creating JSPs with embedded Javascript and HTML, the editor flags (i.e. marks red by default) the specific Javascript code as well as HTML tags, attributes and handlers that I’ve listed below. If you’re already aware of this, please disregard. If not, I hope the info is helpful and will lead to enhancements within the future release.

    1. Programmatic loops in JavaScript are flagged as erroneous (colored red). In the following example, everything to the right of the “<” is red within my editor.

    // Ex:
    for (var i = 0; i < tdCount; i++)
    { // do nothing
    }

    2. Text surrounded by “<” and “>” within JavaScript comments is flagged as an error if the text is not a valid html tag.
    Ex: // Check for <arrow> press

    3. The “onResize” handler for the <body> tag is flagged as an error.
    Ex: <body id=’body1′ onResize=’hndlRsz();’>

    4. The “height” attribute of the <tr> tag is flagged as an error.
    Ex: <tr height=1 bgcolor=’#ffffff’>

    5. The “oncontextmenu” handler of the <tr> tag is flagged as an error.
    Ex: <tr id=’tr1′ oncontextmenu=’selectRow(this);’>

    6. The <nobr> tag is flagged as an error.
    Ex: <nobr><div style=’width:60;text-overflow:ellipsis;overflow:hidden’>Title</div></nobr>

    7. The “contenteditable” attribute of the <input> tag is flagged as an error.
    Ex: <input type=’text’ value=’My Value’ contenteditable=’false’>

    8. The “id” attribute of the <span> tag is flagged as an error.
    Ex: <span id=’s1′><p>Span Me</p></span>

    9. The “background” attribute of the <td> tag is flagged as an error.
    Ex: <td width=’2′ background=’images/back.jpg’>Hello</td>

    Note that these tags, attributes and handlers are (to my knowledge) valid under IE 6+ and NS 7+. If you have recommendations or any suggestions, that would be appreciated.

    Thanks!
    Don

    ——————————-
    What operating system and version are you running? Windows 2000
    What Eclipse version and build id are you using? Version: 2.1.2, Build id: 200311030802
    – Was Eclipse freshly installed for MyEclipse? Yes
    – If not, was it upgraded to its current version using the update manager? NA
    – Are any other external plugins installed? No
    – How many plugins in the <eclipse>/plugins directory are like org.eclipse.pde.*? 7
    What MyEclipse version are you using? Version: 2.6.200, Build id: 200312091200-2.7-RC1
    What JDK version are you using to run Eclipse? 1.4.2_03
    What JDK version are you using to launch your application server? 1.4.2_03
    What steps did you take that resulted in the issue? Created JSP files and inserted JavaScript and html.
    What application server are you using? Tomcat 4.0

    #202402

    Riyad Kalla
    Member

    Don, thank you for the excellent enumeration of enhancements, I’ll pass this along.

    #202405

    No Operation
    Member

    Well, to what HTML version do you refer to?

    1. Programmatic loops in JavaScript are flagged as erroneous (colored red). In the following example, everything to the right of the “<” is red within my editor.

    and

    2. Text surrounded by “<” and “>” within JavaScript comments is flagged as an error if the text is not a valid html tag.

    You have to use html comments to make this work:

    <script language="JavaScript">
    //<!--
    ... // java script goes here
    //-->
    </script>

    3. The “onResize” handler for the <body> tag is flagged as an error.

    There is no “onResize” attribute in HTML4

    4. The “height” attribute of the <tr> tag is flagged as an error.

    There is no “height” attribute for TR in HTML4. There is one for TD and TH.

    5. The “oncontextmenu” handler of the <tr> tag is flagged as an error.

    There is no “oncontextmenu” attribute in HTML4.

    6. The <nobr> tag is flagged as an error.

    There is no “nobr” tag in HTML4.

    7. The “contenteditable” attribute of the <input> tag is flagged as an error.

    There is no “contenteditable” attribute in HTML4.

    8. The “id” attribute of the <span> tag is flagged as an error.

    This seems to be a bug then πŸ™‚

    9. The “background” attribute of the <td> tag is flagged as an error.

    There is no “background” attribute for “td” in HTML4

    NOP

    #202406

    Scott Anderson
    Participant

    Don,

    Is your JavaScript properly commented out? There’s a nice post from our very knowledgable friend NOP in this thread (https://www.genuitec.com/forums/topic/jsp-editor-soooo-slow-under-eclipse-3-m4/&highlight=javascript+comment+nop)
    that explains what is really the proper way to do this. If your script is not properly commented
    out, you might be seeing more errors than you should be.

    #202425

    Don
    Member

    In regards to the Javascript issue, previous editors I’ve used didn’t require the comments yet the code would function fine under current browsers. I don’t mind using them at all and I appreciate the reminder.

    In regards to the HTML tags, YOU’RE RIGHT! However, the current browsers are now supporting programmatic needs (function and form) of web developers beyond what the 6 year old HTML 4 spec. outlines, so I guess I’m requesting that your product do the same. The <nobr> tag is fairly common, as is the “onResize()” function to handle browser resizing and the “onContextMenu()” functionality to support context menus. Placement of the “height” attribute within a <tr> tag is a programmatic style that many have adopted (columns have width while rows have height when columns are encapsulated within rows) and recent versions of IE and NS support.

    I definitely understand your position regarding support of the HTML spec. and appreciate the fast response. You may receive these same editor enhancement requests from many others, especially as the popularity of your product continues to grow. I’m sure it will.

    Thanks!
    Don

    #202426

    No Operation
    Member

    Sorry if you consider my contribution as a flame. And I still mean what I say.

    But I expected a different answer, something like:
    You should support the standard <standardXY> and refer to <some document>
    and not

    many have adopted

    is fairly common

    NOP

    #202438

    Scott Anderson
    Participant

    Don,

    This has been a very informative thread for me as it highlights the difference between the spec and some of the current practices used by the browser vendors. Unfortunately, as a tool vendor we’re really constrained to support the spec. Technically speaking, flagging HTML that isn’t spec compliant is exactly what the editor is supposed to do. Whether that HTML happens to “work” in some subset of available browsers really can’t be determined by us. Which subsets of all the available browsers and versions your HTML is intended for is something known only to you. All we can do is let you know, via error coloring, that you’ve chosen to use something that isn’t spec compliant.

    #202996

    GStretton
    Member

    Putting commented out HTML comments is for old browsers that do not support script tags. I assume MyEclipse is not old and should be able to support script tags. I am evaluting MyEclipse out for my team, and several people saw the all the red caused by a less then sign in the javaScript and immediately decided they did not want the tool, along with the fact that all JSPs outside the web root get compiled (returning an error). I feel less drastic and like the tool basically.

    Having to use HTML comments is unacceptable, we do not support older browsers. I am in a large team that would never agree to such a thing, that is only needed for MyEclipse, which only I have. I would hope the direction would be for MyEclispe to deal with JavaScript and script tags properly with syntax coloring. There is no HTML 4 requirement to put in comments around script code, would you please just admit it is a bug, and that HTML comments are a workaround to it – not recommend coding practice.

    George

    #203017

    support-michael
    Keymaster

    Hi George,

    Thanks for hanging with us and providing constructive feedback. What you will see going forward is the systematic relaxation of system imposed policies and more user defined policies. With 2.8 we are headsdown relaxing the web project structure and adding dependent projects.

    #203083

    No Operation
    Member

    There is no HTML 4 requirement to put in comments around script code

    Oh well, there is. Since the use of

    
    <
    

    defines the start of a tag. It’s use is prohibited elsewhere.

    So HTML comments are not a workaround, they are required.

    NOP

    #211919

    Patryn
    Member

    But why are there problems with:

    <scipt><!–

    for (int i = 10; i >= 0; i–)

    –></script>

    Behind — there is all red, recognized as bad end fpr comment?


    AndrΓ©

    #211922

    Riyad Kalla
    Member

    Andre,
    This should be fixed in 3.8, but to answer your question quickly, <script> is mispelled, so that’s probably why πŸ˜€

    #213266

    paul.lebeau
    Member

    @nop wrote:

    There is no HTML 4 requirement to put in comments around script code

    Oh well, there is. Since the use of

    
    <
    

    defines the start of a tag. It’s use is prohibited elsewhere.

    So HTML comments are not a workaround, they are required.

    NOP

    I’m sorry NOP, but you are not actually correct here.

    See my comment in the thread http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-2807.html

    Section 6.2 of the HTML 4 spec specifically states that <script> and <style> tags should be treated differently, and that ‘<‘ characters are permitted within them.

    #213272

    Neissware
    Member

    What about a switch in the configuration to en-/disable spec conform HTML code ? If it’s disabled, a more relaxed (more common?) HTML should be supported. Is someone needs spec like HTML, enable it …

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: HTML Tag and JavaScript Issues Within The Editor

You must be logged in to post in the forum log in