Thanks and Regards,
What you want to Acheive.
Assign a named cal / document cal to user dynamically or manully
for that you don't even need java script
you can assign from qlikview enterprise management console itself
Retrieving data ...