// JSONscriptRequest -- a simple class for accessing Yahoo! Web Services
// using dynamically generated script tags and JSON
//
// Author: Jason Levitt
// Date: December 7th, 2005
//
// A SECURITY WARNING FROM DOUGLAS CROCKFORD:
// "The dynamic <script> tag hack suffers from a problem. It allows a page 
// to access data from any server in the web, which is really useful. 
// Unfortunately, the data is returned in the form of a script. That script 
// can deliver the data, but it runs with the same authority as scripts on 
// the base page, so it is able to steal cookies or misuse the authorization 
// of the user with the server. A rogue script can do destructive things to 
// the relationship between the user and the base server."
//
// So, be extremely cautious in your use of this script.
//

// Constructor -- pass a REST request URL to the constructor
//
var myScriptCounterHistory = 0; //Almacena el número de script actual

function JSONscriptRequestHistory(fullUrl) {
    // REST request path
    this.fullUrl = fullUrl; 
    // Keep IE from caching requests
    this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
}

// Static script ID counter
JSONscriptRequestHistory.scriptCounter = 1;

// buildScriptTag method
//
JSONscriptRequestHistory.prototype.buildScriptTag = function () {

    // Create the script tag
      var his = document.getElementById('frame_history');
	    his.src = this.fullUrl + this.noCacheIE + "&scriptid=" + myScriptCounterHistory;
}
 

