Uri.query() in the JS runtime returns the wrong value.
uri := Uri.decode("/result.html?id=69")
uri.toStr // --> /result.html?id=69
uri.queryStr // --> id=69
uri.query["id"] // --> null,69 --> OOPS! Expected just "69"
I noticed this when when trying to extract data from a window URL via dom::Win.cur.uri().
andyWed 27 Sep 2017
I don't think there is anything wrong with Uri:
var uri = fan.sys.Uri.decode("/result.html?id=69")
uri.toStr()
"/result.html?id=69"
uri.queryStr()
"id=69"
uri.query().get("id")
"69"
So if there is an issue its probably around encoding/decoding what we are receiving from Window.location -- can you poke around WinPeer.js and see if anything turns up?
SlimerDudeWed 27 Sep 2017
its probably around encoding/decoding what we are receiving from Window.location
Naa, that's the first thing I checked before posting, and it's fine.
I don't know what to say, other than here's a screenshot of my Chrome console that clearly shows null,69 even when using Javascript:
SlimerDude Wed 27 Sep 2017
Uri.query()
in the JS runtime returns the wrong value.I noticed this when when trying to extract data from a window URL via
dom::Win.cur.uri()
.andy Wed 27 Sep 2017
I don't think there is anything wrong with Uri:
So if there is an issue its probably around encoding/decoding what we are receiving from
Window.location
-- can you poke aroundWinPeer.js
and see if anything turns up?SlimerDude Wed 27 Sep 2017
Naa, that's the first thing I checked before posting, and it's fine.
I don't know what to say, other than here's a screenshot of my Chrome console that clearly shows
null,69
even when using Javascript:The
example.html
is just:As for my Chrome version, it's Windows and:
I get the same error on Waterfox / Firefox v 54.0.1 (64-bit).
I'm using some version of Fantom 1.0.69, but I've not re-compiled from tip recently - that said, I don't recall any recent JS Uri work.
I don't have a Fantom dev environment as it takes forever to setup, but if you want to email over a new sys pod, I can re-try it with that?
andy Wed 27 Sep 2017
https://bitbucket.org/fantom/fan-1.0/commits/501e3f349a496394dccde79cc0d6709dafacfa8d
:)
SlimerDude Thu 28 Sep 2017
Groan, thanks for that!
Though I'm disappointed I've wasted so much time on something that was fixed 6 months ago. :(