0

i'm converting in PHP5 a quite old ASP project that was using a lot of server-side javascript.

is there a way to use that code or i'll have to rewrite everything in PHP?

EDIT
this is how the code is embedded in ASP
<!-- #include file=helper.js -->

snippet of my helper.js
<script language=javascript runat=server>
//here are the functions
</script>

then in ASP is see that functions are called as usual ie
response.write myJsfunction()

btw, if i have to rewrite the code, i'll do on my own, not using any software

2
  • If you would be so kind as to embellish your question with some examples and give some indication of how much JavaScript you have and what it does, I may be able to help. Commented Sep 2, 2011 at 10:02
  • PhP is quite easy to learn it isn't to diffrent to javascript quite alot has the very same rules applied, its even quite well documented Php.net has a great community, and using google you'll find your solution for sure for whatever problem you might stumble upon, there's no reason for you to use any rewrite code of sorts would just ruin performance for no good reason imo. Commented Sep 2, 2011 at 11:15

2 Answers 2

1

The answer is "you need to rewrite everything in PHP" PHP does not as is support Javascript on the server-side in reuseable manner. Also, the automatic code transformations are very klunky: clean up work takes more time than building everything by hand from the beginning.

However, you can run server-side Javascript code with tools like node.js and backbone.js. Mixing with PHP code is no-go though as these projects will provide their own, non-PHP-compatible, web-servers.

Sign up to request clarification or add additional context in comments.

Comments

0

I presume you mean jscript? Have you tried asp2php?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.