« Return to Thread: Sending messages to javascript objects

RE: Re: Sending messages to javascript objects

by Ramon Leon-5 :: Rate this Message:

Reply to Author | View in Thread

> And finally, don't forget that we need to add new script to
> #updateRoot:

Why?

>
> updateRoot: htmlRoot
>   htmlRoot addScript: self foo.
>
> What i don't like in code above:
> - script it is added manually, it would be more convenient to
> add it automatically (as result of call to html callMethod:
> #foo of: ...)
> - html root having no option to inline script in html,
> instead it generates <script src=..>, it would be good to
> have an option (a method, like WAHtmlRoot>>addScriptInline:,
> which will generate script with source inlined on page,
> because browser losing much more time to load script using
> separate request rather than simply parse few lines of code ,
> and if your page contains too much scripts , a page load time
> can be  slowed down dramatically.

You most certainly can render inline script directly, no need to attach to
head...

renderContentOn: html
 html script: 'alert("hello")'

Ramon Leon
http://onsmalltalk.com

_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

 « Return to Thread: Sending messages to javascript objects