Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #22113 > unrolled thread
| Started by | "Chris M. Thomasson" <no@spam.invalid> |
|---|---|
| First post | 2013-11-21 16:28 -0800 |
| Last post | 2014-02-11 12:23 -0800 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.javascript
Deriving state from the URL string... "Chris M. Thomasson" <no@spam.invalid> - 2013-11-21 16:28 -0800
Re: Deriving state from the URL string... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-11-21 18:31 -0800
Re: Deriving state from the URL string... "Chris M. Thomasson" <no@spam.invalid> - 2014-02-11 12:23 -0800
| From | "Chris M. Thomasson" <no@spam.invalid> |
|---|---|
| Date | 2013-11-21 16:28 -0800 |
| Subject | Deriving state from the URL string... |
| Message-ID | <l6m8es$qt7$1@speranza.aioe.org> |
I was wondering what method to use for copying the URL and parse out number variables from said copy... How good is`document.URL' in practice?
[toc] | [next] | [standalone]
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
|---|---|
| Date | 2013-11-21 18:31 -0800 |
| Message-ID | <bd51c915-e228-4c3c-96ae-643d7aeb4d3d@googlegroups.com> |
| In reply to | #22113 |
On Thursday, November 21, 2013 6:28:04 PM UTC-6, Chris M. Thomasson wrote:
> I was wondering what method to use for copying the URL and
>
> parse out number variables from said copy...
>
> How good is`document.URL' in practice?
document.URL is DOM level 2, so all compatibility issues that implies. Perhaps (document|window).location is what you want?
A regex to get the params is pretty straightforward:
/^[^?#]+\?([^#]+)/i
example use on <http://example.com/?foo=1&bar=2&baz=3>
var re = /^[^?#]+\?([^#]+)/i,
m = re.exec(document.location);
m[1] // "foo=1&bar=2&baz=3"
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <no@spam.invalid> |
|---|---|
| Date | 2014-02-11 12:23 -0800 |
| Message-ID | <lde0ri$erd$1@speranza.aioe.org> |
| In reply to | #22114 |
> "Michael Haufe (TNO)" wrote in message > news:bd51c915-e228-4c3c-96ae-643d7aeb4d3d@googlegroups.com... > On Thursday, November 21, 2013 6:28:04 PM UTC-6, Chris M. Thomasson wrote: > I was wondering what method to use for copying the URL and > > parse out number variables from said copy... > > How good is`document.URL' in practice? [snip] Thank you Michael! Well, I am almost finished with a cursory little parser that seems to do what I want... :^o Anyway, IMVHO, its going to be neat when a single link can encode the settings for a given fractal! :^)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web