A colleague of mine is using some JavaScript similar to the following in a
ASPX page

<script language="javascript">
        function testscript(theform)
        {
                if ( !/^[a-z|\'|\-\ ][a-z|\'|\-\ ]*[a-z|\'|\-\
]$/i.test(theform.testinput.value) )
                {
                        return false;
                }
        }
</script>

The problem he is facing is that due to the three ' in the line:
        if ( !/^[a-z|\'|\-\ ][a-z|\'|\-\ ]*[a-z|\'|\-\
]$/i.test(theform.testinput.value) )

, the IDE parser is confusing these with quotes, and so assumes that the
rest of the page is within these quotes.
This results in the color coding being incorrect for the remainder of tha
page, and the IDE reporting errors where there are none.

We have added a comment to the line and included a fourth ' in the comment
to *fix* this behaviour.

Does anyone know if this is a known bug in the script parser?

Merak

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to