Originally posted by Ayan Dutta:
I know it is not a very good practise to use scriplet from javascript...
It's not a bad practice, it's impossible. Please read
this article to find out why.
You'll have to submit a form or make an Ajax request to have a server-side effect as a result of a client-side event.