- Home /
Convert Javascript class to a string
Hello everybody!
I would like to know the best way to convert a Javascript class into 1 string, that i can later on pass into the eval() function.
If you may know a better way of executing scripts dynamically, please let me know.
Thank you very much, Nikita Makarov
Out of curiosity - could you write what do you need dynamic script execution for?
Sure. I'm making 2 clients connect via lan and i would like to have one of the clients receive classes from the other for greater customisation.
Do you mean that one player can create a script which would be then passed to the second client?
So I guess you're not looking for converting the whole class, but only some subset of it, which you actually can evaluate.
Apart from eval, I know there are discussions on forums related to dynamic script execution using languages like lua. $$anonymous$$aybe it's a good idea to research this subject a bit.
Your answer
Follow this Question
Related Questions
convert string to array to write to document 0 Answers
How can I change this C# code into Javascript? 0 Answers
Convert string to material 0 Answers
converting javascript to c# 1 Answer
Convert Array to String 3 Answers