5 var f9a_widget_$widget_id = {
6 entrypoint : "$entrypoint",
8 widgetid: "$widget_id",
12 getXHRObj : function(){
13 if (window.XMLHttpRequest) {
14 // code for IE7+, Firefox, Chrome, Opera, Safari
15 this.xmlhttp = new XMLHttpRequest();
18 this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
22 dorequest : function(args, cb) {
23 if (args===null) args = new Array();
25 args['s']=window.location;
26 args['a']=this.argstr;
27 var urlencodedargs = new Array();
28 for(k in args){ urlencodedargs.push( encodeURIComponent(k)+"="+encodeURIComponent(args[k]) ); }
30 var url = this.entrypoint + "?"+ urlencodedargs.join("&");
32 this.xmlhttp.open("GET", url ,true);
34 this.xmlhttp.obj = this;
35 this.xmlhttp.onreadystatechange=function(){
36 if (this.readyState==4){
37 if (this.status==200) {
38 cb(this.obj, this.responseText);
40 document.getElementById(this.obj.widgetid).innerHTML="Error loading widget.";
47 requestcb: function(obj, responseText) {
48 document.getElementById(obj.widgetid).innerHTML=responseText;
53 this.dorequest(null, this.requestcb);
59 f9a_widget_$widget_id.load();
62 document.writeln("<div id='$widget_id' class='f9k_widget'>");
63 document.writeln("<img id='$widget_id_ld' src='$loader'>");
64 document.writeln("</div>");