f5io / bonobo-js

A work-monkey to do your dirty business.
38 stars 4 forks source link

Crashes when page URL contains '/' after the hash (#) or querystring (?) #1

Open hanthomas opened 10 years ago

hanthomas commented 10 years ago

Line 92 contains the following statement:

    _.loc = d.location.href.substr(0, d.location.href.lastIndexOf('/'));

This assumes the last '/' symbol represents the folder name. This is an incorrect assumption. I worked around this problem with the following code:

    _.loc = d.location.href.split('#')[0].split('?')[0];
    _.loc = _.loc.substr(0, _.loc.lastIndexOf('/'));

Not the most elegant, but gets the job done. If you can come up with a better solution, more power to ya!

f5io commented 10 years ago

Should be fixed in 2.0

hanthomas commented 10 years ago

Unfortunately, this problem has resurfaced in 2.0.

On Jun 24, 2014 7:46 PM, Joe Harlow notifications@github.com wrote: Should be fixed in 2.0


Reply to this email directly or view it on GitHub: https://github.com/f5io/bonobo-js/issues/1#issuecomment-47044925

f5io commented 10 years ago

Hi hanthomas, can you please provide a use case. I am unable to replicate this issue with the example from the new release.

/example/?=/hello/ - works as intended /example/#/hello/ - also works as intended

I would be very interested in resolving this issue ;)