fix script tags with ? after the file name
Reported by Brian Moschel | 2010-03-17 20:24:33 UTC
If you include a script tag like:
Env will try to request "steal.js?steal[app]=callcenter&include[env]=development". The browsers will request "steal.js". Env should be made to mirror this behavior. Thatcher said the best place for this is in Envjs.uri, which should detect if its a file or network protocol. There is currently logic that fixes this problem in src/platform/core/html.js, line 94, but it is commented out: filename = Envjs.uri(script.src.match(/([^\?#]*)/)[1], base );Comments and changes to this ticket
-

nickg 2010-03-18 04:52:37 UTC
Hi Brian,
I'll work on this for you since I'm just reworking Envjs.uri anyways. Right now it doesn't handle relative paths very well nor javascript: based urls. So I'll your issue to the pile. Might want to follow ticket #115 as well.
The script tag you posted got mangled by lighthouse. Can you repost the src? (I'm sure I can figure it out, but...).
--nickg
-

Brian Moschel 2010-03-18 05:06:40 UTC
Thanks Nick,
Here is that script tag:
<script type='text/javascript' src='steal.js?steal[app]=myapp&steal[env]=development'></script> -

nickg 2010-03-18 05:40:03 UTC
hi again,
and in this case you are loading the original document as a file, not http? (just checking)
-

Brian Moschel 2010-03-18 06:17:29 UTC
Actually I'm not sure. I'm invoking Envjs with a relative URL like this:
Envjs('callcenter/funcunit.html') -

Thatcher 2010-03-18 06:59:18 UTC
This would imply use of the file:// protocol. Are you wanting to load from
a server via http? I use envjs for both but we do have general issues with
the query string messing stuff up when accessing local files ie java will
throw an exception if you try to openwindow.location = 'file:///tmp/foo.html?bar';
So even if we strip them off before accessing the file, the
window.location.query would now have the expected value. Just something to
keep in mind as we try to iron out the Envjs.uri issues. -

nickg 2010-03-18 18:21:43 UTC
hola,
You can pull this in, and you should be able to move forward, however it's not the final patch.
http://github.com/client9/env-js/commit/3fbc94d726681ca9d843ccb5972...
I'll need chris's help on making the final patch.
--nickg
-

nickg 2010-03-18 18:41:49 UTC
of course the one thing I didnt unit-test had a bug.
I'm not really sure how to tell you the best way to grab my copy of
src/platform/rhino/xhr.js.Cut-n-Paste with
http://github.com/client9/env-js/blob/master/src/platform/rhino/xhr.jsYou can apply the following patches
http://github.com/client9/env-js/commit/3fbc94d726681ca9d843ccb5972...
http://github.com/client9/env-js/commit/560757564062f8bc5468472d95e... -

nickg 2010-03-24 18:43:11 UTC
- Assigned user changed from Thatcher to nickg
Try pulling down the latest changes and see if your problem is resolved (or not).
thanks!
--nickg
-

nickg 2010-03-30 03:03:45 UTC
- State changed from new to resolved
resolving... no one has complained after the fix went in.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
a javascript browser environment
