Skip to Content
avatar image
Former Member

adding javascript variable to <a href=".....

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?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 05, 2006 at 08:38 AM

    <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

    Add comment
    10|10000 characters needed characters exceeded