Forum Moderators: open

Message Too Old, No Replies

Meta refresh to a url with a semi-colon

How do I use meta refresh to url with a semi-colon in it?

         

jomoweb

8:37 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



I am having trouble in IE trying to use meta refresh to a URL with a semicolon in it. I am looking for some kind of escape method I can use here, so the browser doesn't thing that semicolon is ending the script. Here is the code I am currently using:

<meta http-equiv="refresh" content="0;URL=http://sitename.com/page.pvx?;products">

When it refreshes, it cuts the URL off at the semicolon.

jollymcfats

8:49 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



%3b should do the trick.

jomoweb

9:03 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



I tried doing that, however it sends me to
[sitename.com...]
instead of
[sitename.com...]

I need to know how to tell it to unescape that somehow.

jollymcfats

9:06 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Odd, the browser really should be unescaping that for you.

You could try HTML escaping: &59;

jomoweb

9:35 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Thats Internet Exploder for you... Firefox has no problem executing this even with no escape characters.

The html escape character leads to the same problem, since html escape characters end with a semi-colon.

I have also tried both the escape (shown) and unescape versions like so to no avail:

document.write(escape("<meta http-equiv=refresh content=0;URL=http://mysitename.com/iwwida.pvx?;products>"))

jollymcfats

10:34 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Ack, that's horrible. I don't think IE always did that.

If Javascript is an option, you could do document.location = 'http://...' instead of the messing with the refresh header. You can set it up with a window.setTimeout() if you need a delay.

I also happened upon this little monster earlier today. It's awful but does actually seem to work:
<meta http-equiv="refresh" content="0;URL=javascript:window.open('http://example.com/page.pvx?'+unescape('%3b')+'products','_top');">

jomoweb

11:25 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Thanks Jolly. I used the little monster code, it works great. Although folks without javascript enabled will be out of luck it looks like, then again, just about the whole site uses javascript, so I guess it doesn't matter!