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 7796991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:32:31+00:00 2026-06-01T23:32:31+00:00

I have a page, in which there are a couple of Option elements whose

  • 0

I have a page, in which there are a couple of Option elements whose Value point to external pages. My aim is to use Ajax to extract the chosen Option’s Value & use that to load content from external pages. E.g. When a user chooses Volleyball, I will get the ‘volleyball.html’ value, use Ajax to retrieve that page and load its #catalog content into the current page. Here’s my code:

$("select").change(function(){
var selectedURL=$("option:selected",this).val();
if(selectedURL!=="Select One"){
    $("#center").html("<p class='processing'></p>");    
    $.get(selectedURL,function(data){
    var extractedContent=$("#catalog",data);
    console.log(extractedContent); //Firebug says extractedContent is '[]'
    $("#center").html(extractedContent); //Nothing is inserted inside div#content
    },"html");
}

I’m not good at jQuery, and have kind of mixed and matched code from a few posts here to derive at the above. Now I’m not sure what went wrong, but nothing is loaded – the #center div block that is supposed to hold the extracted content is empty.

Can someone please help me spot just what’s wrong with my code above? Many thanks in advance.

  • 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-01T23:32:32+00:00Added an answer on June 1, 2026 at 11:32 pm

    The load() method is perfect for this:

    $('select').change(function () {
        var selectedURL = $('option:selected', this).val();
    
        if (selectedURL !== 'Select One') {
            $('#center').html('<p class="processing"></p>').load(selectedURL + ' #catalog');
        }
    });
    

    It can take only a URL, or it can take a URL followed by a selector which will only load the contents of the matched element (#catalog) into the element it is called on (#center).

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

Sidebar

Related Questions

I have a page which has a couple option links that set GET-based parameters
I have a page which has an Iframe. In that Iframe, there are six
I have a page which displays my database information. Through each loop, there is
I have to made a page which will send Email to Newsletter subscribers. There
I have a page with couple of DIV elements. When user presses the CTRL+ENTER
I have page which is redirected from htaccess. now I can pass the German
I have a page which should show a form with checkboxes, post back if
I have web page which is passing a querystring parameter to page 2: <a
I have a page which contains a html.RenderPartial, that renders an ASP.NET MVC partial
I have a page which has an Html.DropDownList which takes in a viewdata parameter.

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.