0
votes

I want to add jquery script on my zendframework project this is my layout. phtml header part

<?php 
$this->headMeta()->appendHttpEquiv(
'Content-Type', 'text/html;charset=utf-8');
$this->headTitle('ToDo APP')->setSeparator(' - ');

 echo $this->doctype(); ?>  
 <html xmlns="http://www.w3.org/1999/xhtml"> 
 <head>
 <?php echo $this->headMeta(); ?> 
 <?php echo $this->headLink()->appendStylesheet($this->baseUrl().'/css/style.css'); ?>
 <?php print $this->headScript()->appendFile($this->baseUrl().'/js/bootstrap.js')
 ->prependFile('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'); ?>
 </head>

I need http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js for me to be able to use my bootstrap. js file but its not working please help how to properly do it also my css and js folders are place in the public folder.

2
why don't you directly include this in <head> like <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>Satish Sharma
i tried it just now sir but its still not workingdavid
Have you tried ZendX_JQuery View Helpers ? framework.zend.com/manual/1.12/en/zendx.jquery.view.htmlPiotrHyrczak

2 Answers

0
votes

method-1

why don't you directly include this in <head> like

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

method-2
download this jquery file and save in your js folder with name of jquery.min.js

now include this like you include bootstrap.js

<?php print $this->headScript()->appendFile($this->baseUrl().'/js/jquery.min.js'); ?>
0
votes

Simply embed it in your html like this

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>