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

  • SEARCH
  • Home
  • 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 6982763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:19:53+00:00 2026-05-27T18:19:53+00:00

I want to load a dynamic content to specific div name with multiple querystring

  • 0

I want to load a dynamic content to specific div name with multiple querystring from a menu.

Example dynamic menu link

index.php?tag=2
index.php?category=1&tag=2
index.php?category=2&tag=2&location=3

Example query process in PHP for link index.php?category=1&tag=2

$tag = intval($_GET['tag']);
$cat = intval($_GET['category']);

if(isset($tag) && isset($cat)) {
$select = $db->query("SELECT * FROM table WHERE cat=".$cat." AND tag=".$tag."");
... // fetch results
}

Question – With jQuery how to tell user clicked the link then send the callback to PHP process & show the results in the specific div name without refresh the page.

Let me know

  • 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-05-27T18:19:53+00:00Added an answer on May 27, 2026 at 6:19 pm

    Description

    1. You have to create another php page that returns data in json format for the given substring. Your substring is dynamic so you have to get the substring from another element. I suggest a <input type="hidden" value="YourQueryString"/>, its simple. You can put the element next to your link and get the value using jQuery.val().

    2. Then you use jQuery.ajax() / jQuery.get() or jQuery.post() in your index.php to get the data from that page / script. (jQuery.get() and jQuery.post() uses jQuery.ajax() internally)

    3. In the callback method of jQuery ajax you grab the data and build the html from it.
      After that you can use jQuery.html() to set the data to your div.

    Sample

    html / php

    <a class="AnyClassName">Click me</a>
    <input type="hidden" value="category=1&tag=2"/>
    

    jQuery

    $(".AnyClassName").click(function() {
        // lets get the query string
        var queryString = $(this).next().val();
        $.ajax({
          url: "yourNewPage.php?" + queryString,
          context: document.body,
          success: function(data){
            var generatedHtml = "..." // build your html from the data object
            $("#IdOfYourDiv").html(generatedHtml);
          }
        });
    });
    

    Update

    Alternatively your php page can return html (simple page) for your query string. This is easier than build html in the jQuery Ajax Callback. If this is done you can do this

    $(".AnyClassName").click(function() {
        // lets get the query string
        var queryString = $(this).next().val();
        $('#IdOfYourDiv').load("yourNewPage.php?" + queryString);
    });
    

    More Information

    Documentation

    • jQuery.ajax()
    • jQuery.post()
    • jQuery.get()
    • jQuery.load()
    • jQuery.html()
    • jQuery.val()
    • jQuery.next()

    Tutorials

    • jQuery, Ajax, Json and Php
    • Use jQuery and PHP to build an Ajax-driven Web page
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just starting to learn jQuery, and want to load content from a
I want to load 52 images (deck of cards) in gif format from my
I want to load some images into my application from the file system. There's
I want to load some data from mysql into my cocoa application view before
I want to load defined folders into my website from same system, now I
I have a dynamic web page and want to implement dynamic guestbook into DIV
I'm creating a website where I'm doing ajax requests to load some dynamic content
I want to load up the contents of an page to a div using
I want to load one or more DLLs dynamically so that they run with
I want to load a desktop application, via reflection, as a Control inside another

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.