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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:56:47+00:00 2026-06-07T15:56:47+00:00

Very strange problem: I have a 2-part dropdown, where selecting a State will then

  • 0

Very strange problem: I have a 2-part dropdown, where selecting a State will then add a second dropdown giving you a list of MSA Areas in that State.

This is done using a JQuery Get request to a controller that returns the list of Areas in a Select dropdown, like

jQuery(function($) {
  // when the #area_state field changes
  $("#area_state").change(
    function() {
      // make a call and replace the content
      var state = $('select#area_state :selected').val();
      if(state == "") state="0";
      jQuery.get(
        '/getmsas/' + state,
        function(data){ $("#msas").html(data); }
      )
    return false;
    }
  );
})

Note — This code was adapted from the tutorial here: http://www.petermac.com/rails-3-jquery-and-multi-select-dependencies/

This works fine in Chrome and IE, but in Firefox (13.0.1) it does not work, yielding two errors:

Error: junk after document element
Source File: http://localhost:3000/getmsas/Connecticut
Line: 2, Column: 1
Source Code:
<select id="area_msa" name="area[msa]"><option value="">Select Area (Optional)</option>

and

Error: uncaught exception: [Exception... "Node cannot be inserted at the specified point
in the hierarchy"  code: "3" nsresult: "0x80530003 (HierarchyRequestError)"  location:   
"http://localhost:3000/assets/jquery.js?body=1 Line: 6498"]
  • 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-07T15:56:50+00:00Added an answer on June 7, 2026 at 3:56 pm

    So I brute-forced a solution to this. I don’t really understand why this issue is specific to Firefox yet, but may investigate it.

    I was able to fix this by adding an argument for dataType (the last parameter of the get method) explicitly declaring it as html.

    Get is described in the JQuery documentation here: http://api.jquery.com/jQuery.get/

    jQuery.get( url [, data] [, success(data, textStatus, jqXHR)] [, dataType] )
    

    So the code that works is by adding “html” as the dataType argument:

    jQuery(function($) {
      // when the #area_state field changes
      $("#area_state").change(
        function() {
          // make a call and replace the content
          var state = $('select#area_state :selected').val();
          if(state == "") state="0";
          jQuery.get(
            '/getmsas/' + state,
            function(data){ $("#msas").html(data); },
            "html"
            // ABOVE LINE IS THE FIX
          )
        return false;
        }
      );
    })
    

    Again, I need to investigate why this is Firefox-specific; this was driving me crazy, so hopefully it helps someone out.

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

Sidebar

Related Questions

I have a very strange problem with my code. It will fully run the
I have a very strange problem when I'm testing my application on device. I
I have a very strange problem. I have a working WCF service. [ServiceContract] public
I have very strange problem while I am submitting a practice problem on codechef.
I have a very strange problem with using geometry shaders. I made a very
I have a very strange problem in which identical pieces of Javascript are behaving
I experience a very strange problem and I don't have found any help to
Im having a very strange problem, i have a complicated view that returns incorrect
I use the memcache extension for python, and I have a very strange problem.
I have the next very strange situation and problem: .NET 4.0 application for diagram

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.