on 04-28-2016 10:21 AM
Hi All,
I am facing a small issue while communicating to javascript from .htm page. My current code is as below.
<% DATA:lv_url TYPE CRMT_IC_LTX_URL_PART1.
SELECT SINGLE url
FROM ZMYTABLE
INTO lv_url
WHERE SYSTEM_NAME = sy-sysid. %>
<script type="text/javascript">
var lv_url_js;
lv_url_js = <%= lv_url %>.
window.open(lv_url_js,"mywindow","menubar=1,resizable=1,width=350,height=250");
</script>
The issue is when I assign the variable lv_url to lv_url_js. If I just give www.google.com in window.open, it is working. But the above code is not working. Could anybody help?.
Thanks,
Faisa;
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the issue is the dot(.) and missing quotes, put it like this
lv_url_js = "<%= lv_url %>";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Any javascript experts?...
Thanks,
Faisal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.