OpenLayers OpenLayers

Changeset 6184

Show
Ignore:
Timestamp:
02/10/08 15:57:41 (1 year ago)
Author:
crschmidt
Message:

Move ProxyHost addition to Ajax.Request instead of
OpenLayers.loadURL. Makes it easier to write more complex
apps that require ajax.request stuff without duplication
of code. r=elemoine (Closes #1350)

Files:

Legend:

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

    r5869 r6184  
    5959OpenLayers.loadURL = function(uri, params, caller, 
    6060                                  onComplete, onFailure) { 
    61  
    62     if (OpenLayers.ProxyHost && OpenLayers.String.startsWith(uri, "http")) { 
    63         uri = OpenLayers.ProxyHost + encodeURIComponent(uri); 
    64     } 
    6561 
    6662    var success = (onComplete) ? OpenLayers.Function.bind(onComplete, caller) 
     
    288284        OpenLayers.Ajax.Base.prototype.initialize.apply(this, [options]); 
    289285         
     286        if (OpenLayers.ProxyHost && OpenLayers.String.startsWith(uri, "http")) { 
     287            url = OpenLayers.ProxyHost + encodeURIComponent(url); 
     288        } 
     289         
    290290        this.transport = OpenLayers.Ajax.getTransport(); 
    291291        this.request(url);