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

502
Views
How to send parameters in $ .get?

I want to send two parameters in $ .get to the onget page, but these two parameters will be sent blank. Did I pass wrong in $ .get? My question is, did I pass these parameters correctly in $ .get?

 function DeleteEpisode(episodeid) {
  var corseid = document.getElementById("corseidfordelete").value;
Swal.fire({
title: 'delet؟',
showDenyButton: true,
confirmButtonText: 'yes',
denyButtonText: `no`,
}).then((result) => {
if (result.isConfirmed) {
    Swal.fire('save!', '', 'success').then((r) => {
        if (r.isConfirmed)
        {   
            $.get("/Admin/Courses/IndexEpisode/? 
         id="+corseid+"episodeid="+episodeid);                              
        }
    })                           
} else if (result.isDenied) {
    Swal.fire('error', '', 'info')
}
}) };

Method onget

   public void OnGet(long id,long episodeid=0 )
    { 
      _CourseEpisodeApplication.DeleteEpisode(episodeid);
      courseid=id;
      lstEpisode=_CourseEpisodeApplication.GetCourseEpisode(id);                                                       
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You have two errors.
First one is that you did not specify the query separator & in your URI
Here is the fixed one.

$.get("/Admin/Courses/IndexEpisode/?id="+corseid+"&episodeid="+episodeid);     

Secondly, based on your code. The browser will throw an error due to unescaped break line.

$.get("/Admin/Courses/IndexEpisode/?  <---
       -->  id="+corseid+"episodeid="+episodeid);     

For future reference, just use jQuery PlainObject

 $.get('/Admin/Courses/IndexEpisode/', {
        id: corseid,
        episodeid: episodeid
    });
about 4 years ago · Juan Pablo Isaza Report
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!