addPostPageJavaScript added twice to a page (didn't expect it)

21 views
Skip to first unread message

Diego Medina

unread,
Mar 20, 2013, 2:39:04 AM3/20/13
to Lift
Hi,

I was looking around LiftSession and I found

addPostPageJavaScript

So I figured to try it out on a comet class and what I found is that
th JsCmd appears twice on the page.

I added first to fixedRender like this:

override def fixedRender: Box[NodeSeq] = {
S.session map { sess =>
sess.addPostPageJavaScript( () => JsCmds.Alert("hi") )
}
logger.info("called fixed render")
NodeSeq.Empty
}


and the html now has:

<div id="F773049348455MWBFT4_outer" style="display: inline"><div
id="F773049348455MWBFT4" style="display: inline"><div></div><script
type="text/javascript">
// <![CDATA[
jQuery(document).ready(function() {
alert("hi");});
/* JSON Func comet $$ F773049348458LZR2OV */function
F773049348458LZR2OV(obj)
{liftAjax.lift_ajaxHandler('F773049348458LZR2OV='+
encodeURIComponent(JSON.stringify(obj)), null,null);}
// ]]>
</script></div><script type="text/javascript">
// <![CDATA[
var destroy_F773049348455MWBFT4 = function() {}
// ]]>
</script><script type="text/javascript">
// <![CDATA[

alert("hi");
// ]]>
</script></div>

</div>



(note the alert("hi") twice there. Is this expected?

Thanks

Diego




--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://fmpwizard.telegr.am

David Pollak

unread,
Mar 20, 2013, 1:40:49 PM3/20/13
to lif...@googlegroups.com
No. Can you put together an example and open a ticket?


--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net

Diego Medina

unread,
Mar 20, 2013, 9:58:57 PM3/20/13
to Lift
On Wed, Mar 20, 2013 at 1:40 PM, David Pollak
<feeder.of...@gmail.com> wrote:
> No. Can you put together an example and open a ticket?

Thanks David,
Ticket:
https://github.com/lift/framework/issues/1423

and it includes a sample showing what I see.

Thanks

Diego
Reply all
Reply to author
Forward
0 new messages