Re: Passing MULTIPLE values using URL string



Safalra (Stephen Morley) wrote:
On Sun, 30 Sep 2007 14:03:11 +0200, Thomas 'PointedEars' Lahn wrote:
Safalra (Stephen Morley) wrote:
Something like this will extract the query parameters into an
convenient structure:

http://www.safalra.com/programming/javascript/get-data/

You can then use window.location.get.Trouwdd and
window.location.get.Naam.
It is well-known that host objects should not be augmented as their
existence is not guaranteed and their behavior for adding properties is
not defined by the language standard. Therefore, using that code is
very unwise.

I've never heard of this 'well-known' problem before.

Which means you are not quite experienced enough. It has been discussed
here numerous times already.

If window.location doesn't exist then any code attempting to access
window.location.search won't work anyway.

That is true in *this* case.

Is there any current JavaScript-capable browser in which you can't add
properties in this way (if there is then I'll make the effort to
distinguish between the de facto and de jure standards)?

It really doesn't matter whether or not such a HTML UA (not only a browser)
can be named by anyone. Programming in a way that is specified to be
error-prone (see ES3, 8.6.2 §8) is irresponsible, incompetent Voodoo
programming. Especially because there is an easy way that makes the
error-prone approach unnecessary. For example:

http://PointedEars.de/scripts/search.js


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
.



Relevant Pages

  • Re: XHTML or HTML 4 ?
    ... I personally moved from XHTML 1.0 strict to HTML 4.01 strict about a year ago after reading ... Say NO to XHTML ... Both lists above are valid HTML 4.01 strict but there is one which will be parsed faster in all modern browsers. ...
    (alt.html)
  • Re: iframe validation issues
    ... the iframe tag. ... proper html and thus will not validate. ... strict. ... strict version of html or xhtml from html 4.01 on. ...
    (alt.html)
  • Re: html/xhtml
    ... XHTML 1.1 Transitional. ... over HTML, is that it's harder to throw Internet Explorer into ... Strict is the hardest one to work with as it's very strict and you have ... For XHTML, tags without corresponding closing tags, are closed ...
    (alt.internet.search-engines)
  • Re: object and contentDocument
    ... Then don't use XHTML strict (the odds are that you are already not ... Gibberish again. ... yet to be built which parses XHTML 1.0 Strict as HTML 4.01 Strict. ...
    (comp.lang.javascript)
  • Re: Why doesnt this work in Firefox?
    ... declare and validate against HTML 4.01 instead as XHTML ... Strict, XHTML 1.0 Strict and XHTML 1.1. ... Although recent Firefox version support `document.all' to a certain extent, ...
    (comp.lang.javascript)