I'm u开发者_开发知识库sing CakePHP to develop a website..
I'm using the latest jQuery library..
using JsHelper to do something like this:$this->Js->domReady ( $this->Js->alert ('Page loaded !') );
but no JavaScript code was generated on the page !!
this is supposed to generate something similar to:$(document).ready(function(){alert("Page loaded !");});
I'm really surprised !!
is it a problem with jQuery engine ? does the same problem exist with other libraries ?any help will be appreciated ...
Did you try to make it like:
echo $this->Js->domReady ( $this->Js->alert ('Page loaded !') );
Although I use CakePHP as main framework in my development I am not using Js helper. I believe that Javascript need to stay aside. :)
Do you do:
echo $this->Js->writeBuffer();
The call above only constructs the JS code, it does not include it in the document.
精彩评论