Onload Javascript code

You can execute arbitrary Javascript code when you move to a new page or open a popup. Since HTML body tag is in the theme frame.tpl, you have to pass to onload Smarty variable an appropriate Javascript command or commands, with rows terminated by a semicolon.

$_obweb->smframe->assign("onload", "alert('test');");

[Note]Generic onload XHTML syntax

The simplest way of calling a simple Javascript command is calling it directly in the onload tag.

<body onload="alert('hihi!')">

You can also call multiple commands separated by a semicolon.

<body onload="alert('hihi!');alert('how are you?')">

If your script is not just a simple command, it's better to call a separate function.

<body onload="myfunction()">