a javascript code and further translated it in arduino, but it does not work!
It would make sense to post the code, using code tags, and define "does not work", don't you think?
Please read and follow the directions in the "How to use this forum" post.