Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

399
Views
How to pass multiple parameters using Javascript

In project I want to pass variables such as id and model_type from template to view through an onclick function like:

                                                    
<div class="menu-item px-3">
   <a onclick="confirmalertApprove({{assets.id}}, {{assets.modal_type}})" class="menu-link px-3">Approve</a>            
</div>

and

<script type="application/javascript">
    
    function confirmalertApprove(id, model) {
        var assets_id = id;
        var modal_type= model;
        .........

                window.location.href = "{% url 'pending_assets_approval_view'  0, 1 %}".replace('0', assets_id).replace('1', modal_type);
                ..........
                )
            }
        })
    }

the above methode produce an error like:

enter image description here

I am a beginer in javascript. I do not know how to eliminate the error, is there any other way to transfer values ​​instead

" window.location.href = "{% url 'pending_assets_approval_view' 0, 1 %}".replace('0', assets_id).replace('1', modal_type);"

please give me a help to overcome this problem.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!