开发者

JsHelper::domReady function doesn't work !

开发者 https://www.devze.com 2023-02-22 16:07 出处:网络
I\'m u开发者_开发知识库sing CakePHP to develop a website.. I\'m using the latest jQuery library..

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消