on 04-05-2006 9:00 AM
Hello @ all,
I want to use a value of a Javascript array in a HTML like
<script>
var array=new Array();
<b>array[0]</b>=Value1;
array[1]=Value2;
</script>
<a class=SAPBEXBtnStd href="<SAP_BW_URL cmd='LDOC'TEMPLATE_ID='TEST'+<b>array[0]</b>>">to TEST</a>
How can I do this?
<script language="javascript">
var array=new Array();
array[0]=Value1;
array[1]=Value2;
function mailpage()
{
location_str = "<SAP_BW_URL cmd='LDOC'TEMPLATE_ID='TEST'" + array[0] + ">" ;
location.href = location_str;
}
</script>
<A href = "javascript:mailpage();">Test</A>
Regards
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First of all, you should avoid giving your array the namy array.
Is SAP_BW_URL an ABAP var or you state this simple as example. Furthermore pls use quotes around you class def for good HTML
Anyway, this should work:
<script language="javascript">
var myArray=new Array();
myArray[0]='Value1';
myArray[1]='Value2';
function goto_URL(url)
{
url = url + myArray[0];
window.location = url;
}
</script>
<a href="javascript:goto_URL(SAP_BW_URL cmd=\'LDOC\'TEMPLATE_ID=\'TEST\'')" class="astyle">test</a>
Eddy
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.