Why won't my JQuery AJAX Work?

I've used AJAX and JQUERY AJAX before, but I can't get it working in Dreamweaver with a test PhoneGap site.  I'm pasting in my code below. 
I put some alerts in, one to let me know the event got inside the "change" fuction (that works).  Then I have another after the AJAX and it doesn't.  The dropdown hangs and doesn't even close.  I don't get a success, a failure or even a timeout!  WTF?  I have the URL destination in the same folder and I've tried adding the localhost and leaving it off, but to no avail.
HELLLLPPPPP!!!
-- John Kiernan
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery Mobile Web App</title>
<link href="jquery-mobile/jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-mobile/jquery-1.5.min.js" type="text/javascript"></script>
<script src="jquery-mobile/jquery.mobile-1.0a3.min.js" type="text/javascript"></script>
<!-- This reference to cordova.js will allow for code hints as long as the current site has been configured as a mobile application.
     To configure the site as a mobile application, go to Site -> Mobile Applications -> Configure Application Framework... -->
<script src="/cordova.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#mainPulldown").change(function(){
    var lcUrl = "http://localhost/populatestate.php";
//This gives me an alert letting me know the function is firing   
    alert(lcUrl);
    $.ajax({
    type: GET,
    url: lcUrl,
    data: {'which':'USA'},
    dataType: "json",
    timeout: 30000,
    success: function(json) {
      alert("success");
    error: function(x,y,z) {
    // x.responseText should have what's wrong
      alert(x.responseText);
    //  alert("Bad");
    statusCode: {
    404: function() {
      alert("page not found");
alert("timeout");
</script>
</head>
<body>
<div data-role="page" id="page">
    <div data-role="header">
        <h1>Page One</h1>
    </div>
    <div data-role="content">   
        <div id='maindiv' style='height:52px;overflow:hidden; ' align='center'>
                <select id='mainPulldown'  name='mainPulldown' >
                    <option value='Select' selected='selected'>Choose a location</option>
                    <option value='USA' >U.S. States/Territories</option>
                    <option value='CANADA'>Canada</option>
                    <option value='MEXICO'>Mexico</option>
                    <option value='AUSTRALIA'>Australia</option>
                    <option value='BRAZIL'>Brazil</option>
                    <option value='GERMANY'>Germany</option>
                    <option value='Country'>Other Countries with Meetings</option>
                    <option value='Enter'>Enter free form address</option>
                </select>
        </div>
        <div id='statediv' style='height:auto;overflow:hidden;' align='center'>
            <form method='get' id='stateform' action='#' onsubmit='return false;' style='text-align: center;'>
                <select onchange='getnext(this.options[this.selectedIndex].value, this.id)' id='statePulldown'>
                    <option value='Select'>Choose a State</option>
                </select>
            </form>
        </div>  
    </div>
    <div data-role="footer">
        <h4>Page Footer</h4>
    </div>
</div>
</body>
</html>

I got the AJAX working.  It turned out I had GET instead of "GET" in the ajax call.
What makes it maddening was I cut and pasted it from somewhere on the net that said it worked.  Argh.
HOWEVER...
Now I have another problem.  I'm trying to set up a cascading dropdown and I have data flowing back in JSON form and it LOOKS like it's populating the SELECT, but when it's done the length of the SELECT is still 1.
Any ideas?  I've put JavaScript alerts in to show you and I have two different ways of populating the dropdown and neither worked -- nor did the old fashioned "target.options[i] = new Option(opttext,optvalue )".
HELP!
Again, the link is:  http://kierpro.com/aatest/index.html

Similar Messages

  • Why won't my iTunes code work

    Why won't my iTunes code work helpppp

    Hi Benrad09,
    If you are having issues redeeming an iTunes Gift code, you may find the following article helpful:
    Apple Support: If you can't redeem your iTunes Gift Card or code
    http://support.apple.com/kb/HT6021
    Regards,
    - Brenden

  • HT4972 Why won't Kindle or instagram work on my I-Touch? Why do either of them require IOS 4 or 5?

    Why won't Kindle or instagram Apps work on my I-Touch?
    Why do either of them require IOS 4 or 5 and why can't Itouch V2 update to IOS 4 or 5 operating systems?

    1. The developer stopped supporting older iOS versions.
    2. A second generation iPod touch can be updated to iOS 4.2.1 but doesn't have enough RAM to run iOS 4.3 or newer.
    (82591)

  • WHY WON'T STICKY KEYS ACCESSABILITY WORK ON SAFARI/

    WHY WON'T STICKY KEYS ACCESSABILITY FEATURE WORK ON SAFARI? I AM A DOUBLE AMPUTEE AND THIS FEATURE REALLY HELPS ME.
    RANDY

    Do us all a favor, and unlock your Cap keys.  It's considered yelling, and it's a real turn-off for those looking to help posters here.

  • Why won't my lock button work?

    I went to lock my iPod and my lock button won't work. I can't even push it down, it's like stuck down in the hole but it won't pop back up. Everything works fine but I have to wait for it to auto-lock everytime I want to turn it off. Why won't the button pop back up?

    It looks like you have a hardware issue. I don't know why the button doesn't pop up, but You can enable assistive touch. Assistive touch gives you a virtual lock button, so that will solve you problem. You can enable it by going to Settings->General->Accessibillity->AssistiveTouch->On.

  • Why won't my "if" expression work?

    This calculation works:
    IF(A3<1,A3*10,IF(A3<5,20))
    Why won't this one:
    if(A4<1,B4==0,if(A4>1<=2,40,if(A4>2<=3,60,if(A4>3<=4,100,if(A4>4<=5,125)))))
    If you want me to send you the table that I am trying to make this work in, just let me know. Thanks,
    Elaine.

    Never mind, I figured it out! Whew.

  • Why won't megapack for iworks work on my mac?

    Why won't my megapack for iworks work on my macbook pro?

    only pages will work and its crap...what a waste of money.

  • Why won't time capsule router work?

    Why won't the time capsule's wireless router work to allow internet access?  Just got it, new 2 tb!  Lost the excitement of it all now!  Help!  Connecting to new MacBook pros (13" &amp; 2X15"s) as well as a Toshiba laptop.  Followed all the directions and backed up just fine, but have not been able to browse web at all with this crap!

    You do not have to load the airport utility.. a newer version is already included on the computer.
    Just go to the applications / utility directory and start airport utility.

  • Why won't combined AND statement work

    I want to exclude records based on two criteria's: status = 'M' and the status reason = 52.
    The table contains records with status = 'M' and status reason other than 52.
    Also the table contains records with status other than 'M' and status reason = 52 and I want to include those records.
    I first tried using the statement below reasoning that placing the two criteria's in parenthesis would combine them and only exclude records with M 52
    Where (nvl(Status_CD,'A') <> 'M' AND nvl(STATUS_RESN_CD,0) <> 52 )
    However the query removed all records with Status_CD 'M' and all records with Status_Resn_CD 52. 
    Using the Where Not statement worked.
    Where Not (External_Status_CD = 'M' and EXT_STAT_RESN_CD = 52 ) 
    I’m curious why the first statement didn’t work?
    Can anyone explain why the first query didn't combine the 2 statements but a Where Not did?
    Thank you - Mark

    HI, Mark,
    markjames9 wrote:
    I want to exclude records based on two criteria's: status = 'M' and the status reason = 52.
    The table contains records with status = 'M' and status reason other than 52.
    Also the table contains records with status other than 'M' and status reason = 52 and I want to include those records.
    I first tried using the statement below reasoning that placing the two criteria's in parenthesis would combine them and only exclude records with M 52
    Where (nvl(Status_CD,'A') <> 'M' AND nvl(STATUS_RESN_CD,0) <> 52 )
    However the query removed all records with Status_CD 'M' and all records with Status_Resn_CD 52.
    Using the Where Not statement worked.
    Where Not (External_Status_CD = 'M' and EXT_STAT_RESN_CD = 52 ) 
    I’m curious why the first statement didn’t work?
    Can anyone explain why the first query didn't combine the 2 statements but a Where Not did?
    Thank you - Mark
    Another way of looking at it:
    The condition (x AND y) will be TRUE when both x AND y are TRUE.
    If
    sub-condition x is    nvl (Status_CD, 'A') <> 'M'   and
    sub-condition y is  nvl (STATUS_RESN_CD, 0) <> 52
    then any row with status_cd = 'M' fails sub-condition x, therefore the compound condition is FALSE, regardless of status_resn_cd.
    Likewise, and row with status_resn_cd=52 fails sub-condition y, so the compound condition is FALSE regardless of status_cd.
    You used status_cd and status_resn_cd in one example; but
    EXTERNAL_status_cd and EXT_stat_resn_cd in the other.  That's quite confusing.  Also, you'll confuse everyone (including yourself) if status is abbreviated as stat in some places but not in others.  Either way is okay, but be consistent.  The same goes for abbreviating external as ext; pick one or the other, and use the same word in all places.
    Don't forget to check for NULLs.  If  external_status_cd and ext_stat_resn_cd can be NULL, you should say
    Where Not (    NVL (External_Status_CD, 'A') = 'M'
              and  NVL (EXT_STAT_RESN_CD,    0)  = 52
    depending on your requirements.

  • Why won't logic 9.02 work with lion

    Why will logic 9.02 not work with Mac OSX Lion ????????

    The serial included with the TORRENT floating around the web for Logic 9 wont work on anything after 9.0.2
    $100 says this is why said user is freaking on a simple update... just sayin

  • Why won't my HDMI output work after update my iPad to iOS6?

    After updating my iPad to iOS6 it won't play my videos on my tv via HDMI cable. The tv displays "invalid format" I don't know how to chnage the display settings on the iPad because maybe there are none. Is there some backdoor way to change the settings so maybe I can use my $40+ cables I bought?

    This is vatastrophic! I came to a congressional doctor meeting to give a lecture! It would't work!! Only iphone 4 projected muzzy picture and only on photo show!
    Are they crazy? Why did they fricked it up?
    Both were updated to iOs6!!!

  • Why won't my podcast url work

    I wan't to know why my podcast rss won't play. All my episodes show up, but they don't connect and play, all of my files are m4a except one, it is mp3 and that one plays. Isn't m4a  the same as aac. But I can, dowload the episodes though, and they work, you just can't play or preview them in itunes.

    Hi suzique15,
    Welcome to the Apple Support Communities!
    There may be a few different troubleshooting steps I would recommend in this situation. Please read over and use the attached article for troubleshooting this situation with your enter key.
    One or more keys on the keyboard do not respond - Apple Support
    Best regards,
    Joe

  • Why won't Verizon Messages app work on phone with Wi-Fi only?

    I've successfully downloaded and installed the app from Google Play on a phone of mine that I only use wi-fi on.  There is no cellular service to this particular device.  It's set to airplane mode, with wi-fi on, essentially making it a 4.5 inch tablet, or like an android equivalent to an iPod touch.  When I start the app though, it displays the screen shown in the included screenshot, and won't let me connect to the service, despite the fact that a wi-fi connection is present.  I've seen that this is an issue that some others have had.  I have Verizon service with my main phone, I'm not sure why the app that supposedly lets you access your texts via wifi will only do that on tablets or phones with cell service.  Is there any way to get this working? Will there be any updates to allow the functionality that I'm looking for?  I've read that it was present at one time, so why the change?

    According to the Verizon website you are wrong.
    Verizon Messages - Verizon Wireless
    It states "
    Use Wi-Fi to send and receive messages on your smartphone, tablet, PC, Mac and web browser"
    I find personally that you are correct, is the website designed to mislead us? it is the same on the play store for google.
    The difference is not just in one place, it is everywhere it is advertised. So it was meant to work but to charge customers the function was removed is my understanding.

  • Why won't Adobe Bridge CC work with Photoshop CC (2014)?

    When I try to launch Bridge CC from Photoshop CC (2014), I get the Creative Cloud App window and Bridge won't launch.

    After reading a slew of blogs, I've come to the conclusion that Adobe is working on a fix, but it may be some time before that happens. It's really not a deal breaker, as one can launch Bridge first, and that will open PS CC 2014. Time wise it's not much of a difference.

  • Why won't my Ethernet cable work on my Windows Partition on my iMac?

    I have just purchased an iMac and have set up a Windows 7 partiton. However my ethernet connection that works just fine when I use the Mac OS does not work at all on my windows partition.
    It will not let me update my driver since the driver apparently cannot be found, and I obviously cannot find it on the internet since I have no connection!
    Has anyone had the same problem or know how to get around this?

    How is MS Windows installed? Are you using Boot Camp, Fusion, Parallels etc... and if so why not post on those forums. If the issue is Windows related then the issue isn't an iMac issue, it's a Windows problem probably to do with some setting.

Maybe you are looking for

  • HP Slate 500 Camera Fix

    I was having problems with the Slate's webcam when I installed new programs on it. I have seen in a few forums that whenever someone started the camera program they couldn't get an image on the screen. I uninstalled and reinstalled the camera's drive

  • CRM Users Created on ABAP Stack not visible in Portal...........

    Hello All,         I have WAS with ABAP + JAVA  [EP7], Hence using <b> dataSourceConfiguration_abap.xml</b>. as a datasource file in UME. As per my knowledge i cant create users from Portal hence I have created users in ABAP Stack but I am not able t

  • Multichannel audio export in Premiere Pro CS 5

    Anyone know how to get a multichannel audio export from CS5 - I can find plenty of tutorials on CS6 or CC but not 5, which seems to have "16 Channel" as a sequence option (not "Multichannel") - and when it comes to export there is no Multichannel opt

  • Some Open programs not showing indicator light in dock in 10.8

    After upgrade to OSX 10.8 some applications are not showing the indicator light in dock when they are open, even with the check box checked in dock preferences.  Also, the only App available in command+tab is Finder. I think these are related.

  • Error when activating DSO

    Hi All,      We are into critaical situation where we have huge data, some how loaded into BW DSO, there are 3Crore records. when we activate DSO it's throwing an error, time out, we changed RSODSO_Settings but still it doesn't work. As there is huge