jupiterjs/steal — Issue #67: Relative paths producing invalid URL
Author: EricaSmith
Created: 2012-02-20 06:20:34+00:00
State: open

I have a page located at '/bob/pages'. The steal directory is located at '/bob'. My javascript file is located at '/bob/pages/js/bob/headerfooter.js'.

Given the following invocation:
steal('/bob/pages/js/bob/headerfooter.js')
my javascript files load correctly. Yay!

However, if I change the invocation to use a relative path, according the leading './' syntax described here (http://javascriptmvc.com/docs.html#!steal):
steal('./js/bob/headerfooter.js')
I get a javascript error, as steal produces an invalid URL.

According to firebug, it is requesting the following:
http:/../http://localhost:8080/bob/pages/js/bob/headerfooter.js

See the "http:/.." at the start? The text after this in the URL is correct, and does point to the file it ought to, but the leading "http:/.." is causing the request to fail.

For now, having the complete path is a workaround, but it is a bit inconvenient.