Add inline javascript

bipster / 2014-03-30 21:20:29   

Hi,

I'm wondering if there's a way to add inline javascript code in a plugin. I know there's the $OBJ->page->add_jquery() function to add external files, but does a similar function for inline code exist?

Thanks

Vaska A / 2014-03-30 21:22:06   
  1. $OBJ->page->dyn_js[] = ...javascript...;

Loads it into an array and outputs accordingly. ;)

bipster / 2014-03-30 21:46:29   

Tried your code and unfortunately it didn't work. But, it helped me to find out how some formats do it:

  1. $OBJ->page->exhibit['dyn_js'][] =  ...javascript...;

Is this valid for plugins, too?

Vaska A / 2014-03-30 22:23:54   

Wha? ...javascript... isn't code. ;)

Yes, valid for plugins too. You can add js and css to the page output.

This thread has been closed, thank you.