ufront / ufront-mvc

The core MVC framework that powers ufront
MIT License
17 stars 15 forks source link

ClientJS: in-page js not executed when using client to render page #23

Closed kevinresol closed 8 years ago

kevinresol commented 9 years ago

Any <script> tag will be only executed when the page is rendered by server and not if the page is rendered by client. That means many js-based UI won't work if the page is rendered by clientJS.

kevinresol commented 9 years ago

Maybe related: http://stackoverflow.com/questions/610995/cant-append-script-element

jasononeil commented 9 years ago

There's a bigger question of how JS client-side actions should be triggered (and perhaps persisted) as well. I'll have to give some thought to it.

Thanks for the link...

kevinresol commented 9 years ago

http://stackoverflow.com/a/3603496 I think I will try to use the solution in this particular answer to fix the problem, by looking through the document and find out any script tags and re-execute them

jasononeil commented 9 years ago

Yeah that does look good. If we could integrate that solution into CallJavascriptResult that might be a good solution.