I'm trying to dynamically add content when a tab is clicked by echoing a view partial from the controller with a jQuery get, the data returns just fine but any headScript() declarations I make in that partial aren't being set in the page header, declarations made in other partials that are called from this view DO have the appendFile operation succeed. I'm assuming this is because there's some preDispatch happening on the page load that goes through partials and appends headScript items to the header that's not happening when I dynamically load the partial code from the ajax get:
$.ajax({ url: sourceUrl, method: 'get', beforeSend: function(){ $('a[href="'+href+'"]').addClass('load').tab('show'); }, success: function(data){ console.log(data); $("#"+tabID+"-content").html(data); $('a[href="'+href+'"]').removeClass('load'); }, error: function(data){ $("#"+tabID+"-content").html('There was an issue loading the tab. Please try again.'); $('a[href="'+href+'"]').removeClass('load'); } }); This calls an action that has no layout, and simply echoes a partial:
$this->_helper->_layout->disableLayout(); echo $this->view->partial('device/pool-graph.phtml', array('id' => $id)); any <?php $this->headScript()->appendFile(); ?> operations don't seem to append the javascript to the header, is there another way to do this besides including the basic <script src='/js/script.js'> tags in the partial? I'd rather not do that.