Reputation: 14318
I am having a problem with ZendX_JQquery. problem is that jquery loads with
echo $this->jQuery()
and jquery plugin loads with
$echo $this->headScript();
now if i echo out headscript before jquery, i get an error message because plygin depends on jquery. and i have on load function load function loaded with
$jquery->addOnload('some function');
it echos out with jquery before the plugin and get an error message. is there a way to load jquery plugin with jquery method
Upvotes: 0
Views: 371
Reputation: 20726
You can add JavaScript files to the JQuery Stack.
<?php
//index.phtml
$plugin = '/public/js/plugins/xyz.js';
// add plugin to Jquery "echO"
echo $this->jQuery()->addJavascriptFile($plugin);
Upvotes: 0