on 12-15-2004 9:00 AM
I have a BSP page that contains the following
<script...>
alert("<%otr(ITSM/mytext)%>");
</script>
I the original language, the text was i.e. "Wrong value in field 'printer'!". But unfortunately, the translators changed the 's to "s in some languages.
Ok, I could tell the translators to use single quotes instead of doubled or to use \", but I don't want to bother them with JS specifics. Is there a better way to assure that an OTR text doesn't contain characters that JS can't handle?
Try the following code. It worked for me.
[code]
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="phtmlb" prefix="phtmlb" %>
<htmlb:content design="design2003" >
<htmlb:page title="Main page " >
<htmlb:form>
<script>
<%
data: otr_string type string.
otr_string = page->OTR_TRIM( '$TMP/mytext' ).
%>
alert("<%= cl_bsp_utility=>encode_string( in = otr_string encoding = if_bsp_writer=>co_javascript ).%>");
</script>
</htmlb:form>
</htmlb:page>
</htmlb:content>
[/code]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try loading the text into a variable and then manipulating it ???
Just a random thought.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe write yourself a function for your application that wraps around the otr-text include and does javascript-safe character-replacement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.