facebook

Javascript Validation Bug

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

    Eurig Jones
    Member

    I’m not 100% sure if this is a bug, but I don’t understand the logic behind it anyway. I’ve got a few JS files in my workspace which lists…

    src declaration is not found.
    style declaration is not found.
    Identifier ‘style2’ allready declared as var*

    function changeFlag(element, imagePath)
    {
        var filename = element.value;
        if (filename === '')
        {
            filename = '0';
        }
        document.getElementById("flag").src = imagePath + filename + ".png";
    }
    
    function toggleLayer(whichLayer)
    {
        if (document.getElementById)
        {
            // this is the way the standards work
            var style2 = document.getElementById(whichLayer).style;
            style2.display = style2.display? "":"block";
        }
        else if (document.all)
        {
            // this is the way old msie versions work
            var style2 = document.all[whichLayer].style;
            style2.display = style2.display? "":"block";
        }
        else if (document.layers)
        {
            // this is the way nn4 works
            var style2 = document.layers[whichLayer].style;
            style2.display = style2.display? "":"block";
        }
    }

    I’m also getting ++ and — is considered harmful type warnings. So i went to the MyEclipse Editor javascript properties and unticked this option but didn’t seem to make any difference.

    Hope this helps!
    Eurig
    http://www.eurig.co.uk

    #257212 Reply

    Riyad Kalla
    Member

    Eurig,
    You can ignore the ‘src’ and ‘style’ errors, it’s just the JavaScript validator not being aware fo those implicit objects. We have a similar limitation on some AJAX frameworks as well. You can disable JavaScript validation if the errors are very distracting for now (the validator will get smarter over time).

    Also you need to clean/rebuild your project for the “harmful” setting to take effect, we have that filed as a bug, sorry about that.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Javascript Validation Bug

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