Hi Faisal,
Your JS code is pretty straightforward, But it might be an escaping issue. You can directly escape your URL on the BSP Layou by doing:
lv_url_js = '<%javascript= lv_url %>';
See the BSP Escaping Help Topic for more info.
Let me know if it works.
BR - JYves
PS: Line 09 in your example ends with a period and is missing some quotes (unless they are already part of lv_url).