[thelist] Javascript Querystring?

Saila, Craig Craig.Saila at bgminteractive.com
Mon Nov 18 12:43:01 CST 2002


> -----Original Message-----
> From: .jeff [mailto:jeff at members.evolt.org]
> Sent: November 18, 2002 1:13 PM

> ... but it doesn't need to be built that way.  why build it
> to require a w3c-dom compatible browser when it can be built
> to work on dom 0 browsers just fine?

Because that's how I built it! ;)

(The script snippet was taken from my own site's core script. Since the
only versions of my site that gets it should be the W3C-DOM compliant
browsers -- which make up about 90% of my audience -- that's how I built
it.

The DOM 0 way would be just as good, and maybe better, but I'm more
comfortable doing it the W3C-DOM way.

For the record, here's the DOM 0 version of the aforementioned script
which works in most browsers:
function changeLink(v){
  var links = document.links;
  for(x = 0; x < links.length; x++){
    v = escape(v)
    var the_link = escape(links[x])
    if((the_link.indexOf(v)!=-1){
      links[x].href = unescape(the_link) + v
    }
  }
}
)

--
Cheers,

Craig Saila
------------------------------------------
craig at saila.com : http://www.saila.com/
------------------------------------------



More information about the thelist mailing list