Hello everyone,

Hope you're all in a good mode today :)

I was just thinking, is it possible for use to ever
create widgets that can be downloaded after a page has
been rendered?

AfroAPI uses java to do a similar task, but what about
doing something like this:

dummywidget=new initWidget()
dummywidget.onload=function(e){
   mywidget=Widget()
   //bla bla code for mywidget
}

The above widget could use LoadPanel to download the
following widget html file (widget.html):

<form name="widgetscript">
<textarea name="widgetcode">

Widget=function(){}
Widget.prototype.method1=function(){}
Widget.prototype.method2=function(){}
Widget.prototype.method3=function(){}
</textarea>
</form>

Async-widgets could be registered using sometime like:

DyAPI.Register("Widget","widget.html")
this could then create a wrapper function called
Widget() that when created would load the widget.html
file(using loadpanel or similar) and trigger the
onload event: 


DyAPI.Register=function(wname,wfile){
  var src="function(){\n"
  +"var new lp=LoadPanel();"
  // event listener code here
  +"lp.onload=function(e){\n"
 
+"eval(e.getSource().doc.widgetscript.widgetcode.value);"
  +"}\n"
  "}"
  eval(wname+"="+src)
}


Any thoughts, ideas, improvements, etc?

--
Raymond


__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[email protected]/

Reply via email to