Sha256: c1dea33e7ee4460dd58a04de3f97a3c59c789ae0c42444b3f82bfa3dcfe5ce7f
Contents?: true
Size: 755 Bytes
Versions: 4
Compression:
Stored size: 755 Bytes
Contents
Skyline.Utils = { /* Function: getJsLocation(filename) Find the url, filename and parent url of "filename" Returns: A Hash with the following keys: filename - The filename you passed in url - The full SRC/url of the filename base - The parent url of filename */ getJsLocation : function(filename){ var sElements = document.getElementsByTagName("SCRIPT"); var r = {}; for (var i=0; i<sElements.length; i++) { src = sElements[i].src; if (src && src.indexOf(filename) != -1) { r.filename = filename; r.base = src.substring(0, src.lastIndexOf('/')); r.url = src; if ((p = src.indexOf('?')) != -1){ r.query = src.substring(p + 1); } return r; } } } };
Version data entries
4 entries across 4 versions & 2 rubygems