[development] php and js in a programmatic block
jeff at ayendesigns.com
jeff at ayendesigns.com
Sun Nov 28 16:02:38 UTC 2010
Hi Fred. I -have- read that, but I guess when I read the description of
inline referring to the current page... I have to force myself to think
of a function creating block contents for a function that creates a
block for a module AS being the current page as opposed to being busy
-creating- the current page!
With regards to the dynamic values. If I were putting the js directly in
the module code rather than a .js file, I would do something like:
print "var x='$myvar'";
What's the normal way of handling this when importing a .js? Would I put
a placeholder in the js and use regex to plug in the values?
On 11/28/2010 10:45 AM, Fred Jones wrote:
>
> See http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_add_js/6
> in particular:
>
> Add inline JavaScript code ('inline'): Executes a piece of JavaScript
> code on the current page by placing the code directly in the page.
> This can, for example, be useful to tell the user that a new message
> arrived, by opening a pop up, alert box etc.
>
More information about the development
mailing list