embedded js code working