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.
精彩评论