decodeURIComponent : strange problem

S

sw_nantes.RD

Hello,

I have a strange problem :
The following code work with firefox but not with IE :

var winlocation = decodeURIComponent(window.location);

This error doesn't occur under all the stations (however they have all
the same version of IE)

Anyone has an idea ?
 
M

Martin Honnen

The following code work with firefox but not with IE :

var winlocation = decodeURIComponent(window.location);

This error doesn't occur under all the stations (however they have all
the same version of IE)

Which error message exactly do you get or why do you think it does not
work with some IE?
As for the same IE versions behaving differently that is possible as you
can update the JScript engine on a machine without updating IE so you
could have one machine with IE 5 and JScript 5 (where decodeURIComponent
is not implemented) and another machine with IE 5 and JScript 5.5 (or
5.6) (where decodeURIComponent is implemented).
 
S

sw_nantes.RD

Sorry I forgot to give the error message :
"Object required"

How can I know the jscript version ?
 
M

Martin Honnen

It seems that some stations have JScript 5.1 and others JScript 5.6

As said decodeURIComponent is implemented since JScript 5.5 so if you
control those machines you could update the script engines, look at
http://msdn.microsoft.com/scripting/ for the download.

On the web you should only use decodeURIComponent after checking for it e.g.
if (typeof decodeURIComponent != 'undefined') {
decodeURIComponent(expression)
}

Why do you think you need to call decodeURIComponent on window.location
anyway?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top