...

View Full Version : URL Encoding



Brotherhood313
07-30-2007, 10:01 PM
I'm working with a .xul file. There is no spot for these but they are closest to HTML I believe.

Basically in this file you cannot use "&". So I was looking at URL Encoding and I found that "&" = "%26".
The link I need is:

http://www.linkhere.com/forum/index.php?act=Msg&CODE=01

I tried just putting in

http://www.linkhere.com/forum/index.php?act=Msg%26CODE=01 but that does not work.

If anyone has any ideas on how to get this working, it would be greatly appreciated.

Arbitrator
07-30-2007, 10:11 PM
Use & or &.

Brotherhood313
07-30-2007, 11:08 PM
Use & or &.

That would be too easy of course though. I cant use "&" at all on this page or else it gives errors. I need to get the & symbol without actually using "&" at all on the page.
Thanks for the reply though.

Anyone else have any ideas?

Arbitrator
07-30-2007, 11:20 PM
That would be too easy of course though. I cant use "&" at all on this page or else it gives errors. I need to get the & symbol without actually using "&" at all on the page.It would help if there were more context. If this was in a JavaScript/ECMAScript script or CSS style sheet, you could use \u0026 or \000026, respectively.

Brotherhood313
07-30-2007, 11:25 PM
Guess I posted in the wrong place. It's in XML, sorry.


<menu id="new-menu2 menuitem-iconic" label="My Controls" onclick="gr_open(event, 'http://www.linkhere.com/forum/index.php?act=UserCP&CODE=00');">

I just need some way to get that "&" sign to work without actually having "&" in the page.

\u0026 and \000026 do not work for this.

Arbitrator
07-30-2007, 11:34 PM
Guess I posted in the wrong place. It's in XML, sorry.


<menu id="new-menu2 menuitem-iconic" label="My Controls" onclick="gr_open(event, 'http://www.linkhere.com/forum/index.php?act=UserCP&CODE=00');">

I just need some way to get that "&" sign to work without actually having "&" in the page.

\u0026 and \000026 do not work for this.What I meant by context was explaining why the character is not allowed so that, perhaps, one could work around that. If thatís a normal XML document, use of the ampersand character should be fine as long as itís used to make a character or entity reference. If the code referenced by the onclick attribute is JavaScript/ECMAScript, I would expect \u0026 to work also.

Brotherhood313
07-30-2007, 11:59 PM
Ah thanks. Apparently &amp; did work. I was told that "&" could not be used at all. I guess they were wrong. Thanks for the help :)

Arbitrator
07-31-2007, 12:13 AM
Ah thanks. Apparently &amp; did work. I was told that "&" could not be used at all. I guess they were wrong. Thanks for the help :)Yeah, the character is only forbidden as a literal since it signifies the start of a character or entity reference (just like < is forbidden as a literal since it starts a new tag).

Brotherhood313
07-31-2007, 12:29 AM
Maybe they werent completely wrong.

&amp; works here:

<menu id="new-menu2 menuitem-iconic" label="My Controls" onclick="gr_open(event, 'http://www.gamerenders.com/forum/index.php?act=UserCP&CODE=00');">

But not here:

<menuitem class="gr-user menuitem-iconic" label="Inbox" onclick="gr_open(event, 'http://www.link.com/forum/index.php?act=Msg&CODE=01');" oncommand="gr_open(null, 'http://www.link.com/forum/index.php?act=Msg&CODE=01');" />

I wonder what I could use on the 2nd one. Its a different id so im assuming thats why its not working the same.

Arbitrator
07-31-2007, 12:47 AM
Maybe they werent completely wrong.

&amp; works here:

<menu id="new-menu2 menuitem-iconic" label="My Controls" onclick="gr_open(event, 'http://www.gamerenders.com/forum/index.php?act=UserCP&CODE=00');">

But not here:

<menuitem class="gr-user menuitem-iconic" label="Inbox" onclick="gr_open(event, 'http://www.link.com/forum/index.php?act=Msg&CODE=01');" oncommand="gr_open(null, 'http://www.link.com/forum/index.php?act=Msg&CODE=01');" />

I wonder what I could use on the 2nd one.I would expect them to work identically. Make sure that both ampersands are escaped on the second one.


Its a different id so im assuming thats why its not working the same.I donít think that thatís it, but itís worth noting that the HTML, SVG, XHTML, and XML id attributes donít allow spaces. Iíve donít know about XUL though.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum