Krissy,

I think js->writebuffer is for something else ... 

Just move the js stuff from header to bottom as:

<?php echo $this->Html->script('jquery.js'); ?>
<?php echo $scripts_for_layout; ?>
</body>
</html>


Andras Kende
http://www.kende.com

On Mar 29, 2011, at 2:25 AM, Krissy Masters wrote:

> I am just trying out the new JS helper and going thru the book I simply
> added this into the middle of a random page to test it out
> 
> <?php $this->Html->scriptStart(array('inline' => false, 'cache' => true));
>    echo $this->Js->alert('I am in the javascript');
>    $this->Html->scriptEnd();?>
> 
> In the layout added 
> 
> <?php $this->Js->writeBuffer();?>
> <?php //echo $this->Js->writeBuffer();?>
> </body>
> </html>
> 
> Sure enough I get the alert
> 
> But I end up with the code at the top of my page after the rest of the other
> scripts. I thought it would output the scriptStart / End at the bottom?
> <script type="text/javascript" cache="1">
> //<![CDATA[
> alert("I am in the javascript");
> //]]>
> </script>
> 
> Even if I completely remove $this->Js->writeBuffer(); it still gets added to
> the top. I clearly am not understanding the point of this.
> 
> Any help would be great.
> 
> Thanks,
> 
> K
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to