开发者

kohana how to bundle javascript into view

I have a javascript with a counter, and a view. I want the javascript counter to start whenever some one hits the buy product button.

my problem is: how开发者_StackOverflow社区 can i control the javascript from the kohana controller, and how can i bundle the javascript into a view?

thanks!


You can bundle the JS into the view just like into a typical .php page.

If page causes a post-back just start the JS timer on page load as usual.

If page uses AJAX, place JS into the content view. Then have a controller send a message that triggers the JS timer to count down.

Otherwise I'm not exactly sure what you're asking.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜