OpenLayers OpenLayers

Changeset 5921

Show
Ignore:
Timestamp:
01/28/08 15:27:54 (10 months ago)
Author:
ahocevar
Message:

"_getScriptLocation cannot handle query string". Patch originally by john.pulles@geodan.hl, improved by beau@beaugunderson.com. Thanks! r=crschmidt,me (closes #1263)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers.js

    r5919 r5921  
    4444                if (src) { 
    4545                    var index = src.lastIndexOf(scriptName);  
     46                    // set path length for src up to a query string 
     47                    var pathLength = src.lastIndexOf('?'); 
     48                    if (pathLength < 0) { 
     49                        pathLength = src.length; 
     50                    } 
    4651                    // is it found, at the end of the URL? 
    47                     if ((index > -1) && (index + scriptName.length == src.length)) {   
    48                         scriptLocation = src.slice(0, -scriptName.length); 
     52                    if ((index > -1) && (index + scriptName.length == pathLength)) { 
     53                        scriptLocation = src.slice(0, pathLength - scriptName.length); 
    4954                        break; 
    5055                    }