PDA

View Full Version : IE 5.0 bug?


Spudhead
08-16-2002, 11:29 AM
I've noticed some anomalous behaviour when testing on IE 5.0 and IE 6.0, concerning escaped values.

This involves some ASP, but it's a client-side Javascript problem, so bear with me :)

The following line calls a javascript function using variables pulled from a database via ASP:

<a href="javascript:doFunction('<%=escape(myDatabaseValue)%>')">click me</a>

my javascript function currently simply pops an alert box with the value it was passed.

If ASP writes the (escaped) string "My%20Value" to the page - so that view source in the browser reveals:

<a href="javascript:doFunction('<My%20Value')">click me</a>

In IE 6, the function will alert exactly that.

In IE 5.0, the function will alert: My Value


I'm only posting it for a bit of a rant, and in case anyone else was having / has seen the same thing. It's easy enough to work around, just another example of... Micro$haft, I guess... :rolleyes:

beetle
08-16-2002, 02:44 PM
Does escaping the % work?alert('My\%20Value');