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.href;
26 args['a']=this.argstr;
27 var urlencodedargs = new Array();
29 if (typeof args[k] != 'function')
30 urlencodedargs.push( encodeURIComponent(k)+"="+encodeURIComponent(args[k]) );
32 var url = this.entrypoint + "?"+ urlencodedargs.join("&");
34 this.xmlhttp.open("GET", url ,true);
36 this.xmlhttp.obj = this;
37 this.xmlhttp.onreadystatechange=function(){
38 if (this.readyState==4){
39 if (this.status==200) {
40 cb(this.obj, this.responseText);
42 document.getElementById(this.obj.widgetid).innerHTML="Error loading widget.";
49 requestcb: function(obj, responseText) {
50 document.getElementById(obj.widgetid).innerHTML=responseText;
55 this.dorequest(null, this.requestcb);
61 f9a_widget_$widget_id.load();
64 document.writeln("<div id='$widget_id' class='f9k_widget'>");
65 document.writeln("<img id='$widget_id_ld' src='$loader'>");
66 document.writeln("</div>");