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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:55:36+00:00 2026-06-19T02:55:36+00:00

Please review the code fragments below: First, the Javascript call: function getNewSelect(property_id){ xajax_getSelectDropDown(unique_id); $(.chzn-select).chosen();

  • 0

Please review the code fragments below:

First, the Javascript call:

function getNewSelect(property_id){
  xajax_getSelectDropDown(unique_id);
  $(".chzn-select").chosen();
}

Next, the PHP XAJAX function:

function getSelectDropDown($unique_id){
    //CODE ABOVE THIS POINT HAS BEEN REMOVED, IT IS IRRELEVENT FOR THIS EXAMPLE

        //Code for if no matches were found:
        $html2 = NULL;

        $objResponse = new xajaxResponse();
        if(mysql_num_rows($result) > 0){
            $objResponse->assign('subDiv', 'innerHTML', $html);
        }else{
            $objResponse->assign('subDiv', 'innerHTML', $html2);
        }

        $objResponse->script("$('.chzn-select-ajax').chosen();");

    return $objResponse;
}

Finally here’s the HTML code:

<div id="subDiv"></div>

Now, when the above PHP function goes into the else and assigns $html2 – I expect nothing to be displayed to the user. On most browsers, that’s fine and it works perfectly. Unfortunately on internet explorer (IE 9 I can confirm, I haven’t been able to test other versions), it actually displays the following where the DIV call:

null

If a result is found and it does not process the else, then it works correctly on all browsers and shows a new drop down as it’s supposed to.

What can I do to fix this problem? Is this a known issue with IE? Thanks.

I want to add so there’s no confusion, the CHZN call is just to add a style to the dropdown, as found here: http://harvesthq.github.com/chosen/

  • 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-19T02:55:38+00:00Added an answer on June 19, 2026 at 2:55 am

    Better use this:

        if(mysql_num_rows($result) > 0){
            $objResponse->assign('subDiv', 'innerHTML', $html);
        }else{
            $objResponse->assign('subDiv', 'innerHTML', '');
        }
    

    IE is showing null because $html2 = NULL……better try it with $html2 = ” ” or something like that 😉

    Saludos.

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

Sidebar

Related Questions

I have a memory leak at NSDate . Please review the code below. -(void)myMethods:(NSDate
Below is my code . Please review it . 1. bool isUnavailable = db.Deploys.Where(p
Please review my brief example code below and tell me if there is better,
Please review my .htaccess code below. The code below was suggested by I User
Please review the example code below, I have a class file that is loaded
Please review below code and advice what needs to be done in order to
All, I have a controller which saved the posted file(Please review below code). It
Please review the below code and advise what is wrong with it when using
Please i need help, this code below works fine on my localhost, php5.3+ but
Please review code: /* Run1.java */ package test; import java.util.Iterator; import java.util.SortedSet; import java.util.TreeSet;

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.