Skip to content


addPostPageJavaScript added twice to a page #1423

fmpwizard opened this Issue · 4 comments

3 participants

Lift Web Framework member

As discussed with David

Sample app here:

git clone
cd lift_starter_2.4
git checkout comet-fixedRender-issue

(note the branch name comet-fixedRender-issue )

Calling addPostPageJavaScript from fixedRender like this:

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

results in the html having the alert("hi") twice.

@dpp dpp was assigned
Lift Web Framework member

What happens if you use S.appendJs? Does that differ from what addPostPageJavaScript should do?

@dpp dpp was unassigned by fmpwizard
@fmpwizard fmpwizard self-assigned this
Lift Web Framework member

I'll try that and post back

Lift Web Framework member

So I'm actually slightly confused right now… The bug demonstrated in the linked repository branch seems to be that when you load the page, the alert runs twice. However, at least with 2.6-RC1, opening a new tab only causes two alerts on the second page—the original page is untouched. The README in the target repository seems to indicate I should be seeing things run in the original page as well?

Lift Web Framework member

Okay, did a bit of investigating here. This is a bit tangled up because S.jsToAppend looks up the post page functions, but so does CometActor's fixedRender. Both are used by the CometActor to append JS—one OnLoad, in the ActionMessageSet handler, and one directly, in the base fixedRender implementation.

I have very little idea about how these two pieces and fixedRender are supposed to interact, so I'm going to leave this for another rainy day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.