daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var crossrequest = Class.create({
  2.    initialize:function(requesturl, options)
  3.    {
  4.         this.requestUrl = requesturl;
  5.         this.killIeCache = '?noCacheIE=' + (new Date()).getTime();
  6.         this.head = $$('head')[0];
  7.         this.scriptid = 'generatedscript' + (new Date()).getTime();
  8.        
  9.         this.params = leaf.isset(options.parameters)? options.parameters : null;
  10.        
  11.        
  12.         this.create();
  13.    },
  14.    
  15.    create: function()
  16.    {
  17.        if(this.params == null)
  18.        {
  19.            var qry = this.requestUrl + this.killIeCache;
  20.        }
  21.        else
  22.        {
  23.            var qry = this.request.Url + '?';
  24.            
  25.            this.params.each(function(val, index){
  26.                qry += index + "=" + val+ "&";
  27.            });
  28.            
  29.            qry += this.killIeCache;
  30.        }
  31.        var s = new Element('script', {id: this.scriptid, src: qry, type: 'text/javascript'});
  32.        this.head.appendChild(s);
  33.    },
  34.    
  35.    kill: function()
  36.    {
  37.        this.head[0].removeChild(this.script);
  38.    }
  39.    
  40.  
  41.    
  42.    
  43. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top