Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37677

Problems getting javascript working

$
0
0
by Sergi Rodríguez.  

Hi guys,

I have read and understood the javascript guidelines, since I want to use a YUI module, I followed this tutorial.

The problem is that I can't make it to work, I know the $this->page->requires->js_init_call() it's being called because I have used a debugger, but nothing happens after that.

My block root is on blocks/workflow_diagram, there I have a file called module.js with the following content, similar to the example given on the last link:

M.block_workflow_diagram = {
Y : null,
transaction : [],


init : function(Y, params){
alert(params);
this.Y = Y;
}
}

I try to call this file with the following lines (also following the tutorial):

$jsmodule = array(
'name' => 'block_workflow_diagram',
'fullpath' => '/blocks/workflow_diagram/module.js',
'requires' => array("overlay", "anim", "plugin")); //on this line you are loading three other YUI module

$this->page->requires->js_init_call('M.block_workflow_diagram.init', array('this is the param1 value'), false, $jsmodule);

But this seems to not work properly, since nothing pops on the screen. I also have tried to make it work following the example on the javascript guidelines, without success.

I'm truly lost and about to get crazy because of this thing that seems so simple, so any help would be really appreciated.

Thanks!


Viewing all articles
Browse latest Browse all 37677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>