Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10

Thread: URL Encoding

  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    URL Encoding

    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:
    Code:
    http://www.linkhere.com/forum/index.php?act=Msg&CODE=01
    I tried just putting in
    Code:
    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.
    Last edited by Brotherhood313; 07-30-2007 at 10:06 PM.

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Use & or &.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arbitrator View Post
    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?

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Quote Originally Posted by Brotherhood313 View Post
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #5
    New Coder
    Join Date
    Jul 2006
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Guess I posted in the wrong place. It's in XML, sorry.

    Code:
            <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.

  • #6
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Quote Originally Posted by Brotherhood313 View Post
    Guess I posted in the wrong place. It's in XML, sorry.

    Code:
            <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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #7
    New Coder
    Join Date
    Jul 2006
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #8
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Quote Originally Posted by Brotherhood313 View Post
    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).
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #9
    New Coder
    Join Date
    Jul 2006
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe they werent completely wrong.

    &amp; works here:
    Code:
    <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:
    Code:
            <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.

  • #10
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Quote Originally Posted by Brotherhood313 View Post
    Maybe they werent completely wrong.

    &amp; works here:
    Code:
    <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:
    Code:
            <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.

    Quote Originally Posted by Brotherhood313 View Post
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •