Closed tresf closed 8 years ago
@bberenz I found a painfully simply way to resolve URLs... It constructs an <a href="..."/>
tag with the specified URL and reads the value right back out. It works with IE7 and higher.
I've also placed in a small portion of browser-detection, not sure if it's warranted.
Question... how can we assume when a URL is being supplied to the data element? Can we determine that in js, or is the logic all Java-side?
function makeAbsolute(url) {
if (document && typeof (document.createElement == 'function')) {
var a = document.createElement('a');
a.href = url;
return a.href;
}
return url;
}
The logic for that check is all Java-side, unless they specify the type as file. Would it be enough to just provide that method as part of QZ?
Implemented via 52ef9f550f1280693a5e45af96f20d0a6572389e
Investigate the possibility of supporting relative file paths in 2.0
Currently, data must be a full path requiring all of our code examples to use a
getPath()
function which our clients won't necessarily have.