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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:16:36+00:00 2026-05-30T09:16:36+00:00

DataPull.php: CASE CityList: echo <select style=’width:132px;height:243px;’ size=’17’ id=’CityListA’ name=’CityListA’ onChange=’SubCityList(this.value);’>; $result = $db-> query(SELECT

  • 0

DataPull.php:

    CASE "CityList":
        echo "<select style='width:132px;height:243px;' size='17' id='CityListA' name='CityListA' onChange='SubCityList(this.value);'>";
        $result = $db-> query("SELECT region_id,region_name FROM dwrel_region ORDER BY region_name");
        while ($row = $db-> fetch_assoc($result)){
            echo "<option value='".$row["region_id"]."'>".$row["region_name"]."</option> \n";
        }
        echo "</select>";
        break;

JavaScript:

function CityList(){
    try{var xmlhttp=new XMLHttpRequest();}catch (e){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){return false;}}}
    xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4 && xmlhttp.status==200){getEl("CityList").innerHTML=xmlhttp.responseText;}}
    eMsg = "DataPull.php?get=CityList";
    xmlhttp.open("GET",eMsg);
    xmlhttp.send();
}

It works just fine for me. Was reading around JQuery/AJAX and surprised you could do it via $(function(){}); part.. but I don’t or can’t begin to understand where and how to put it together “as is” with the code I have above. Hopefully someone out there is kind enough to guide me to the right direction using AJAX, pulling and output results.

Was trying to understand how to be able to use this, even reading mentioned the use of JSON? (I think) or data “as is”, something.. Oh I don’t know.. Anyways, hopefully someone could help me put this together and then I could understand it even better.

Thanks!

EDIT:
After weeks from this post, learned a new way to do this:
in CSS:

.LoaderIcon {width:100%;height:100%;background:url('./images/Loading.gif') no-repeat center center;}

in JQuery:

$.ajax({
    beforeSend: function(){ $('#SOMEID').addClass('LoaderIcon'); },
    url: "SOME PARAMETER",
    success:function(data){
        $('#SOMEID').removeClass('LoaderIcon');
        $('#SOMEID').html(data)
    }

This has been working like charm for me, hopefully it would benefit others 🙂
});

  • 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-30T09:16:38+00:00Added an answer on May 30, 2026 at 9:16 am

    Try this

    function CityList(){
     $("#YOUR_SPINNING_DIV_ID").html('<img src="PATH_TO_SPINNINGANIM_GIF"');
     $.ajax({
    url: "DataPull.php?get=CityList",
    success: function(data ){
      $("#CityList").html(data );
    $("#YOUR_SPINNING_DIV_ID").html("");
     }
    });
     }
    

    and then call this function on any event that you are observing like button clicks or window onload. If you are doing it on windown onload then Jquery equivalient will be

     $(document).ready(function() {
    
     $.ajax({
    url: "DataPull.php?get=CityList",
    success: function(data ){
      $("#CityList").html(data );
     }
    });
     )};
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I'm missing something here. in Script: $('#dialog:ui-dialog').dialog('destroy'); $('#dialog-modal').dialog({ width:150, height:150, resizable:false, draggable:false,
My site (ASP.NET + C#) has FAQ data pull from another site's web service
I have an application where I am launching a new Activity, and need to
I have a domain object which represents a 1:n relationship between database tables. public
I'm new to multithreading (and a somewhat beginner / intermediate programmer), and so I
In my application I need to pull data from server approximately each 3 minutes,
I am very new to Apache camel and I am exploring how to create
I'm having problems writing a custom DS source filter to play a TS stream
When I design my system from scratch, I often face a dilemma whether my
SSIS ETL Design I'm trying to build a ETL job. Below are my primary

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.