Click here to Skip to main content
15,913,584 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi can you help me again.. how to have multiple parameter in javascript?

this part i want to add another parameter:
window.location.replace("/AcctConfirmation/Index?acctCode=" + acctCode )

i want something like this:
window.location.replace("/AcctConfirmation/Index?acctCode=" + acctCode + "?acctName=" custName)

hope you get my point.

XML
<script type="text/javascript">
    $(document).ready(function () {
        $('#myDataTable tbody tr').dblclick(function () {

            var acctCode = $(this).find('td:eq(0)').html();

            window.location.replace("/AcctConfirmation/Index?acctCode=" + acctCode )


        }).hover(function () {
            $(this).css('background-color', '#ccc');
        }, function () {
            $(this).css('background-color', '#fff');
        });
    });
</script>
Posted

1 solution

humm,
I wont answer you. I will give you pointer
whenever you have to concat two string in javascript then you must have to use + to concat two string. Which you already did. But surprisingly you don't know how to do this right after few character....................

and when you create a URI you add different variables with & sign. example:
Var1=3,
Var2=someother. so the URI would be
Var1=3&Var2=someother
 
Share this answer
 
Comments
naijeru 14-Sep-12 22:31pm    
thanks.. :D solved my problem..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900