Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8313143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:23:32+00:00 2026-06-08T20:23:32+00:00

I have a page that lists courses. When a student clicks on one of

  • 0

I have a page that lists courses. When a student clicks on one of the course titles, it will use AJAX to pass the parameter (courseId) to a second page which will return the course details. How can the parameter (courseId) be accessed in the second page? If I put a value directly in the source instead of accessing the parameter, it shows the details:

var idInput = 12345;
var regNoInput = 098766;

When I tried getElementById to access the parameter, it didn’t show any details:

var idInput = document.getElementById("courseId").value;
var regNoInput = document.getElementById("regNo").value;

I also tried accessing the parameter as a PHP variable, but still no details:

var idInput = "${courseId}";
var regNoInput = "${regNo}";

this is my first page script, the parameter is pass using url:

  success: function(json_results){
    $('#list').append('<ul data-role="listview" data-inset="true"</ul>');
    listItems = $('#list').find('ul');
    $.each(json_results.rows, function(key) {
     html = "<li data-mini='true' id='icon'><a href='MRegisteredClassesDetail.html?
            courseId=" + [json_results.rows[key].courseId] + "&regNo=" +
            [json_results.rows[key].regNo] +"' rel='external'>" + 
            json_results.rows[key].courseName+ "</a>" + "<a 
            href='http://137.57.102.146:8080/Training/MRateCourse.phone?courseId="+ 
            [json_results.rows[key].courseId] + "&regNo=" +   
            [json_results.rows[key].regNo] + "' rel='external'>RATE THIS COURSE</a>
            </li>" ; 
     listItems.append(html); 
    }); 

and this is my second page, it should read the parameter value:

  var idInput = "${courseId}";
  var regNoInput = "${regNo}";

   success: function(json_results){
     $('#list').append('<ul data-role="listview" data-inset="true"</ul>');
     listItems = $('#list').find('ul');
     $.each(json_results.rows, function(courseId) {
     html  ='<h1 align=center>'+json_results.rows[courseId].courseName+'</h1>';
     html +='<li>Registration Number:'+json_results.rows[courseId].regNo+'</li>';
     html +='<li>Registration Date:'+json_results.rows[courseId].regDate+'</li>';
         listItems.append(html);
     });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:23:35+00:00Added an answer on June 8, 2026 at 8:23 pm

    i declare a variable

    var idInput = getParameterByName('courseId');
    

    and define the function

    function getParameterByName(name) {
            var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
            return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
        }
    

    it works well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HAML page that lists some links to delete things that looks
I have a page (below) that has a datagrid that lists item's returned from
I have a page that, depending on input from a previous page, lists a
I'm attempting to setup a MenuItem that will have a submenu of page numbers
I have an MVC app that is basically one page with a bunch of
I have a page here that shows two classgroups - groups/lists of students -
I have a page that displays a list with a of elements with a
I have a page that displays a list of tickets. On each of these
I have a web page that displays a list of documents stored on the
I have a page ItemList that shows a list of items using div's. After

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.