On 1/5/07, Jason Bunting <[EMAIL PROTECTED]> wrote:
If the url of the page is: http://www.foo.com/bar.aspx?baz=blah#bottom And the code is: var args = parseQueryString(document.URL); var paramValue = args.baz; At this point paramValue is equal to "blah#bottom" instead of just "blah" as I would expect; the fragment identifier is included when present; is there another way to do this? Is my use of document.URL incorrect? Currently I am working around this with: parseQueryString(document.URL.split("#")[0]);
The input to parseQueryString is not documented to be a URL, it's documented to be a URL query string. It will strip a leading question mark, but not a fragment identifier or the other parts of a URL. In other words, you're getting the wrong result because you're passing the wrong input.
document.URL
"http://mochikit.com/examples/interpreter/?a=1&b=2#c"
items(parseQueryString(document.URL))
[["http://mochikit.com/examples/interpreter/?a", "1"], ["b", "2#c"]] -bob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~----------~----~----~----~------~----~------~--~---
