So, you'd probably do something like:

<lift:MyScriptManager>
  <body script:onload="alert(XXXX)">
  </body>
</lift:MyScriptManager>



class MyScriptManager {
  def render(in: NodeSeq) =
   bind("script", in, FuncAttrBindParam("onload",
    what => Text("XXXX".r.replaceAllIn(what.text, "'Hello World'"))
,"onload"))

}

Please give it a try.

On Sun, Apr 26, 2009 at 5:47 PM, [email protected] <
[email protected]> wrote:

>
> Hi David :
>
>  I think I need some really simple example, for example
> <body onload="alert('<%= alert_message %>')" >
>
> Can you give me the detail how to make this ?
> It doesn't seem to work as <body onload="alert('<Lift:Alert.message /
> >')" >
>
>
> From the Liftbook, there are some advanced examples with Comet and
> Ajax,
> but my problem is even some simple things I don't know how to make it.
>
> The previous javascript code needs 3 parameters, "start_time",
> "end_time" and an "until_string"( just for the message to display),
> but in the original PHP there are two functions with the same name,
> it's the code that decides which to use.
>
> The javascript is to display a message to show much time left, it
> calls itself to replenish the display,
> that's why there is an setTimeout('realtime_output()', 1000); in the
> end of the function.
>
> And other than javascript, I would like to know how to make dynamic
> CSS.
>
>    <style type="text/css">
>    <!--
>      body{background-color:<%=background_color>;color:<
> %=text_color>;}
>      A:link { color: blue; }
>      A:visited { color: blue; }
>      A:active { color: red; }
>      A:hover { color: red; }
>      .left_real_time{ color:<%=text_color>; background-color:<
> %=background_color>;font-size:11pt;border-width:0px;border-
> style:solid;}
>    -->
>     </style>
>
> My solution to this CSS is still a snippet, because I don't know how
> to make a dynamic CSS other than snippet.
>
> Thanks to the help.
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to