Popups: JS initialization w/ Page Include

  • 1
  • Question
  • Updated 3 years ago
  • (Edited)
I am running into a similar situation, in which I am trying to load a popup and I need to run javascript to hide / initialize certain items on the page.  However, the popup is using a page include.  The page Include by itself works great as I have an in-line javascript code that runs and initializes everything.  However, when I put it inside the popup and call it from another location it doesn't work, its as if the initialization code is not running.

I've tried the action framework as well, by calling an initialization script after the pop-up action.  I get the same results.

Any ideas? Thank you.

Note: This conversation was created from a reply on: Run script snippet before popup.
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Peter Kong

Peter Kong, Employee

  • 440 Points 250 badge 2x thumb
Zach left this reply from the original conversation:

Is the initialization code inside a wrapper like this:

 skuid.$(function(){
     // code here
});

Or something like that?

If so, place it inside of a block like this:

skuid.$(document.body).one('pageload',function(){
   // code here
});
(Edited)