Forum Moderators: open

Message Too Old, No Replies

What do you use to parse the url?

         

willeffects

7:38 pm on Mar 30, 2005 (gmt 0)

10+ Year Member



I wouldn't even consider myself a rookie with javascript but know it can be done, so thanks for any help.

What function would I use to have javascript read the page it is on, grab the url which is like:
http://www.example.com/boards/index.php?showtopic=88837&mode=linear

and say if the url includes "mode=linear" then apply this style sheet?

Thanks!
Will

[edited by: DrDoc at 3:45 pm (utc) on Mar. 31, 2005]
[edit reason] examplified and delinked URL [/edit]

orion_rus

8:54 am on Mar 31, 2005 (gmt 0)

10+ Year Member



I think it would be better to analize this on a server side, like php,perl or aspx
Good luck to you!

SpaceFrog

9:04 am on Mar 31, 2005 (gmt 0)

10+ Year Member



window.url.split('\&')

then test indexOf('mode') ...

killroy

10:07 am on Mar 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or document.innerHTML and then apply a url regex to it

SN

SpaceFrog

12:45 pm on Mar 31, 2005 (gmt 0)

10+ Year Member



I dont see how you could grab an url with innerHTML?