[OpenLayers-Trac] Re: [OpenLayers] #3478: Missing slash in location.pathname under Internet Explorer 10

OpenLayers trac-20090302 at openlayers.org
Fri Mar 23 04:48:36 EDT 2012


#3478: Missing slash in location.pathname under Internet Explorer 10
--------------------+-------------------------------------------------------
  Reporter:  vog    |       Owner:                                     
      Type:  bug    |      Status:  reopened                           
  Priority:  major  |   Milestone:  2.12 Release                       
 Component:  Util   |     Version:  2.11                               
Resolution:         |    Keywords:  ie10 internet explorer 10 slash url
     State:         |  
--------------------+-------------------------------------------------------
Changes (by ked):

 * cc: ked (added)
  * status:  closed => reopened
  * version:  2.11 RC3 => 2.11
  * resolution:  fixed =>


Comment:

 Replying to [comment:8 vog]:
 > In short, the existing fix is necessary and sufficient. In Internet
 Explorer ≤ 9, `window.location.pathname` has always a leading slash, but
 `a.pathname` (where `a` is an `<a href>` tag) has no leading slash. So the
 workaround is really only needed for `a.pathname` and not for
 `window.location.pathname`.

 I just found that when using OpenLayers in IE modal and modeless popups
 (IE9 in my case) `window.location.pathname` doesn't have a leading slash.
 This can be tested [https://www.fiddler2.com/test/path.htm here].

 To fix this, 'OpenLayers.Util.createUrlObject' (around line 1469)

 {{{
 var parts = loc.pathname.split("/");
 }}}

 needs to be changed to something like this:

 {{{
 var pathname = (loc.pathname.charAt(0) == "/") ? loc.pathname : "/" +
 loc.pathname;
 var parts = pathname.split("/");
 }}}

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3478#comment:10>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list