问题
i wonder, if there's any transpiler available, which converts (simple) php code to javascript?
what i am not looking for is ajax stuff or javascript libraries imitating php functionality, but i am looking for a translater, which is able to generate javascript code from php code (similar of what google is doing with GWT and the java-to-javascript transpiler).
thanks!
回答1:
The uniter php to js transpiler can do this: http://asmblah.github.io/uniter/
回答2:
You can use something like this: http://www.harmony-framework.com/
But notice, that Javascript has lots of security issues PHP avoids. And straight conversion is not always possible for Database-related function calls or some other PHP extensions
来源:https://stackoverflow.com/questions/1995362/looking-for-transpiler-php-to-javascript