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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:41:14+00:00 2026-05-13T05:41:14+00:00

I have an issue with a jQuery script I wrote that is driving me

  • 0

I have an issue with a jQuery script I wrote that is driving me a bit nuts. As usual it works perfectly in Firefox but falls over in all IE versions.

I have the following HTML. It is generated using Velocity so it should be part of the DOM:

<select name="groups" id="groups" type="select">
<option value="group1">group1</option>
<option value="group2">group2</option>
<option value="group3">group3</option>
</select>

My jQuery script looks like this:

jQuery(document).ready(function() {
    jQuery("#groups option").click(function () {
        alert(group);
        var group = jQuery(this).attr("value");
        AJS.safe.ajax({
            url: "/plugins/userlookup/userlookup.action",
            type: "POST",
            dataType: "json",
            data: {
                group: group
            },
            success: function(data) {
                alert(data);
                jQuery("#users").empty();
                for(var i=0; i < data.userList.length; i++) {
                    var userstr = "<option value=\""+data.userList[i]+"\">"+data.userList[i]+"</option>";
                    jQuery("#users").append(userstr);
                }
            }
        });
    });
});

Basically there is a drop down list of “groups” and upon selecting a group an AJAX call is made to fetch users from that group and populate another field. In IE, selecting groups does nothing, nor does it give any Javascript errors. I have tried to step through it but looks like the “click” function is not binding at all to any of the elements as none of those alerts are called and breakpoints are never hit in the debugger. I’ve tried calling the AJAX URL directly in the browser, but unlike Firefox I don’t get the JSON output, IE tries the download the action and fails.

I have stepped through all the code in Firefox and the backend code and that is all working.

Can anyone see what could be wrong with what I’ve done?

  • 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-13T05:41:15+00:00Added an answer on May 13, 2026 at 5:41 am

    Try using the change event instead of the click event. That is, when the selection is changed, then update your user select with the related data. Note, also, the change to get the selected option from the groups select (this will be the select instead of the option).

    jQuery(document).ready(function() {
        jQuery("#groups").change(function () {
            var group = jQuery(this).find(':selected').attr('value');
            AJS.safe.ajax({
                    url: "/plugins/userlookup/userlookup.action",
                    type: "POST",
                    dataType: "json",
                    data: {
                            group: group
                    },
                    success: function(data) {
                            alert(data);
                            jQuery("#users").empty();
                            for(var i=0; i < data.userList.length; i++) {
                                    var userstr = "<option value=\""+data.userList[i]+"\">"+data.userList[i]+"</option>";
                                    jQuery("#users").append(userstr);
                            }
                    }
            });
        });
    });
    

    I believe that the click event isn’t actually generated in IE for the option elements, it’s generated on the select itself. This may be different, though, if you are using a multiselect, though it doesn’t appear that you are.

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

Sidebar

Ask A Question

Stats

  • Questions 274k
  • Answers 274k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Just let the login page refresh itself whenever the session… May 13, 2026 at 2:19 pm
  • Editorial Team
    Editorial Team added an answer Perhaps the easiest way is to just analyze the access… May 13, 2026 at 2:19 pm
  • Editorial Team
    Editorial Team added an answer Yes, best place to store that settings is web.config file.… May 13, 2026 at 2:19 pm

Related Questions

I am working with two plugins in jQuery: jquery.scrollTo and jquery.Colorbox and I'm having
Firstly, is there a way to use document.write() inside of JQuery's $(document).ready() method? If
Walter Rumsby provided a great answer to Where to place JavaScript in an HTML
I have an issue with this jquery code below. Please give me advice or
I seem to have an issue with using jQuery to do a PostBack. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.