Jump to content

Search the Community

Showing results for tags 'ajax'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 117 results

  1. I am trying to get data from other server and i get right response as well as below error XMLHttpRequest cannot load http://dex2y.xyrn.com/data/profiledata.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:56711' is therefore not allowed access. Request: $.ajax({ url: "http://dex2y.xyrn.com/data/profiledata.json", async: false, dataType: "json", success: function (json) { exampleValues = json; } }); Response: { "header": "Bob's Profile", "name": "Bob Robertson", "address": "1010 Some Street, New York, NY, 10001", "phone": "(212) 555-1212", "interests": "Bob likes apples, big ones and floating ones." } and i am not able understand about this error.
  2. http://craft.minestatus.co MineStatus - Minecraft Servers MineStatus is a brand new modern minecraft server list. Personal Server Analytics Votifier Voting Sharing Profiles Comments Blogs I have recently created my second site. Tell me what you think.
  3. self_learning

    Change text with AJAX

    I read topic about Ajax at W3School. I made firstAjax.html. I attached it. Then I create ajax_info.txt from where I want to receive data and print on html page. But code not work. Please help! firstAjax.html ajax_info.txt
  4. To sum things up... I'm looking for as much reviews as possible. I've been working on minestatus for the last year now. I've come across many programming roadblocks and developments to further improve the quality, user impression, user interface, and user engagement. If you guys have any ideas on how to make my site better in any of those categories that would be amazing. Thank so much! Link to site: http://minestatus.co Site Name: MineStatus Site Description: MineStatus is a new social sharing plateform I've created. It allows users to make there own profiles, upload content, display the content. You can even share your content on MineStatus to almost any other social network without flaw. I plan on making a developer site to go along with it to share my practices with everybody. Site Owner/Developer: Myself, I am the lead developer and creator of MineStatus Network Site Address: Here is the link to the site : https://minestatus.co Extra Info: Some technologies I've already integrated: Open Graph Protocol* Twittercards* *for those who don't know here is a link, Open Graph Protocol, Twittercards.
  5. Hi, I have the below jQuery script that should list relevant country flag before the name of flag's country. The flags are named "flags", and are of PNG format. Everything is working fine, except flags are missing. I would appreciate showing me what to change in the code to make the flags appear. function createDropDown(){ var $form = $("div#country-select form"); $form.hide(); var source = $("#country-options"); source.removeAttr("autocomplete"); var selected = source.find("option:selected"); var options = $("option", source); $("#country-select").append('<dl id="target" class="dropdown"></dl>') $("#target").append('<dt class="' + selected.val() + '"><a href="#"><span class="flag"></span><em>' + selected.text() + '</em></a></dt>') $("#target").append('<dd><ul></ul></dd>') options.each(function(){ $("#target dd ul").append('<li class="' + $(this).val() + '"><a href="' + $(this).attr("title") + '"><span class="flag"></span><em>' + $(this).text() + '</em></a></li>'); }); }
  6. Mad_Griffith

    POST to Twitter with JS calls

    Hi, I am currently trying to implement the posting of a canvas image to a Twitter wall.Below, first you see the JS I came up with.What I can't figure out is how am I supposed to get the keys and tokens provided in the PHP function below that code. Such PHP function is contained in the uploadFile.php file.JS: var base64img = canvas.toDataURL().split(',')[1]; $.ajax({ url: "uploadFile.php", type: "POST", data: base64img, processData: false, contentType: "application/octet-stream", }).done(function(respond) { alert(respond); }); PHP: function _microsite_last_tweets($search) {define('CONSUMER_KEY', 'my key');define('CONSUMER_SECRET', 'my key');define('ACCESS_TOKEN', 'my key');define('ACCESS_TOKEN_SECRET', 'my key');$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);$content = $connection->get("account/verify_credentials");if ($search[0] == '@' && strpos($search,' ') == false) {$user = substr($search, 1);$tweets = $connection->get("statuses/user_timeline", array("screen_name" => $user, "count" => "4"));}else {$search = urlencode($search);$tweets = $connection->get("search/tweets", array("q" => $search . '+exclude:retweets', "result_type" => "recent","count" => "4"));}return $tweets;}
  7. Merkaber

    PHP - AJAX example question

    Hello everyone, I have a question about the PHP - AJAX example (http://www.w3schools.com/php/php_ajax_php.asp). In the PHP file, there is the variable " $hint ". But what is this variable used for? Here the code: $q = $_REQUEST["q"];$hint = "";// lookup all hints from array if $q is different from ""if ($q !== "") { $q = strtolower($q); $len=strlen($q); foreach($a as $name) { if (stristr($q, substr($name, 0, $len))) { if ($hint === "") { $hint = $name; } else { $hint .= ", $name"; } } }} You are declaring $hint = "". After there is no input, that could happen to $hint. Why there is the if clause? Maybe I am blind, but I don't get it. Second questions is about this code part: echo $hint === "" ? "no suggestion" : $hint; How you can use operators without function, what does ' $hint === "" ' and what does ' : ' ?I already red the whole example more than twice... but I don't get it. A short explanation or a link to another website which is explaining these would be awesome. Thank you in advance! (By copy and pasting, the example works, but I wanna understand it)(I am not native English speaker, please excuse my mistakes)
  8. Yes I'm a newbie in AJAX '&&' JavaScript. As I'm a pupil here, I find hurdle almost in any code... There is an AJAX code with some number value in it, like 4 - 200, but I can't understand the nature of this digits or what they are indicating... function loadDoc() { var xhttp; if (window.XMLHttpRequest) { // code for modern browsers xhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { document.getElementById("demo").innerHTML = xhttp.responseText; } You see: "== 4 && xhttp.status == 200)" ... what for? Thanks to anyone who'll reply to this 'double-dumb' question!!
  9. tech991

    Bookmark system

    Hi to all. I'm new in php development. I'm trying to do a bookmark system. I have an intern search engine that extract data from a database table build in MYSQL that show as link and the user can click on and appear es text html. I want to give the possibility to add a star button near these link and when the user click on to bookmark. I found 2 ways to do this, but I'm sure that exist more solution that can do better or not: 1- Give the possibility to the user that when click on button near the link that extract data from the database to add this on a bookmark table. 2- When the user click on button add data to a the bookmark browser with a javascript as this (http://stackoverflow.com/questions/10033215/how-do-i-add-an-add-to-favorites-button-or-link-on-my-website). I think is the easiest solution but I'm not sure what can do the correct way to this. Any advice is welcome:)
  10. jaylow

    mute user from chat

    Hi, i am playing a game and there is a user in chat that bothers me and other players a lot but he does not break any game rule... i was wondering if there is a way i could block or mute his text with a JavaScript if so, does anyone have a tutorial on how to code something like this? the chat have no ID but every chat message is put out like this. <table border="0" padding="0" cellspacing="0" width="100%"> <tbody> <tr> <td width="90" class="chat"> <div id="202525"></div> 2015-08-24 06:06:00 </td> <td style=""> <a href="javascript:newmsg('The Martyr','')" style="">The Martyr:</a> " so I starting to give up" </td> </tr> </tbody></table> and it looks like this in chat: 2015-08-24 06:06:00 The Martyr: so I starting to give up i was thinking i could use the user name 'The Martyr' in some way to block that user i would love to code something that would just remove the lines from the chat box. and any other line the user typed and will type. i just have no idea where to start. any kind of help would be appreciated thanks
  11. I've been making tons of progress on my vehicle fit guide. I've made a drop down box dynamically populate based on previous selections, and now I need those selections to search the xml file and return my results. My old code only searched by the vehicle year, and that returned all vehicles with the same year. I'm trying to parse my XML using multiple variables, and now can't get any results to return. how am I able to search for models, then search for years within the model? here are my code snippets below, which currently only search the whole XML file for similar years: <!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="xmlcss.css"><script data-require="jquery@*" data-semver="2.1.4" src="http://code.jquery.com/jquery-2.1.4.min.js"></script><script type="text/javascript">jQuery(document).ready(function($){ var $xml; var make = $('#make'); var model = $('#model'); var year = $('#year'); var front1 = $('#Front_Location_1'); var frontsize1 = $('#Front_Size_1'); $.get('fitguide3.xml', function(data){ $xml = $(data); var rows = $(data).find('ROWSET ROW'); var makes = []; $.each(rows, function(index, element){ var _make = $(element).find('MAKE').text(); makes.push('<option value="' + _make + '">' + _make + '</option>'); }); makes = $.unique(makes); make.append(makes.join('n')); }, 'xml'); $('#make').on('change', function(){ var _value1 = $(this).val(); var _models = $xml.find('ROWSET ROW:contains("'+_value1+'")'); var models = []; console.log(_models); $.each(_models, function(index, element){ var _model = $(element).find('Model').text(); models.push('<option value="' + _model + '">' + _model + '</option>'); }); models = $.unique(models); model.find('option').remove(); model.append(models.join('n')); }); $('#model').on('change', function(){ var _value2 = $(this).val(); var _years = $xml.find('ROWSET ROW:contains("'+_value2+'")'); var years = []; console.log(_years); $.each(_years, function(index, element){ var _year = $(element).find('YEAR').text(); years.push('<option value="' + _year + '">' + _year + '</option>'); }); years = $.unique(years); year.find('option').remove(); year.append(years.join('n')); }); // $('#make').val() // $('#model').val() // $('#year').val() $('#year').on('click', function(){ var _value3 = $(this).val(); var finalmodel = $('#model').val(); var _front1 = $xml.find('ROWSET ROW:contains("'+_value3+'")'); console.log(_front1); <!-- $("#Front_Location_1").html(""); --> $.each(_front1, function(index, element){ var _front = $('#frontspeakers').val(); var front = []; front.push('<p>' + element + '</p>'); front = $.unique(front); front1.append(element); }); })});</script></head><body><p id="test"></p><select id="make"><option value='0'>---Select Make---</option></select><select id="model" name="model"></select><select id="year"></select><table style="width:100%"><tr><td>Front Location 1</td></tr><tr><td id="frontspeakers"></td></tr><tr><td id="Front_Location_1"></td></tr></table> And this is how my XML file is set up: <?xml version="1.0"?><ROWSET><ROW><MAKE>ACURA</MAKE><Model>CL</Model><YEAR>2001-2003</YEAR><Front_Location_1>Door</Front_Location_1><Front_Size_1>6 1/2</Front_Size_1><Front_Location_2>Sail Panel</Front_Location_2><Front_Size_2>1 </Front_Size_2><Rear_Location_1>Deck</Rear_Location_1><Rear_Size_1>6 x 9</Rear_Size_1><Rear_Location_2></Rear_Location_2><Rear_Size_2></Rear_Size_2><Other_Speakers></Other_Speakers></ROW><ROW><MAKE>ACURA</MAKE><Model>CL</Model><YEAR>1999-1999</YEAR><Front_Location_1>Door</Front_Location_1><Front_Size_1>6 1/2</Front_Size_1><Front_Location_2>Sail Panel</Front_Location_2><Front_Size_2>1 </Front_Size_2><Rear_Location_1>Deck</Rear_Location_1><Rear_Size_1>6 x 9</Rear_Size_1><Rear_Location_2></Rear_Location_2><Rear_Size_2></Rear_Size_2><Other_Speakers></Other_Speakers></ROW> This searches for them, but returns every model with the same years. Work-in-progress version located HERE Any help would be great!
  12. I used AJAX to retrieve concatenated data from a XML document. Now I need to store that data into a Javascript array. How do I do this? My Javascript Code: var SVG_Data var Retrieved_Data var Coordinate_Pair var Element_List var Counter function Setup() { SVG_Data = new XMLHttpRequest(); SVG_Data.open("GET","http://localhost:8080/exist/rest/db/apps/HTML_Student/Database_Retrieval.xq", true); SVG_Data.onreadystatechange = function () { if (SVG_Data.readyState = 4) { Retrieved_Data = SVG_Data.responseText; document.getElementById("Information").value = Retrieved_Data; Coordinate_Pair = new Array(); Coordinate_Pair.push.apply(Retrieved_Data); Element_List = new Array("Top_Ladder_Line","Middle_Ladder_Line", "Bottom_Ladder_Line"); for (Counter = 0; Counter < 3; Counter++) { document.getElementById("Information").value = Coordinate_Pair[Counter]; document.getElementById(Element_List[Counter]).setAttribute("points", Coordinate_Pair[Counter]);} } } SVG_Data.send(); } The concatenated data I received from the eXist database: "60,30 60,80 150,80 150,30", "60,130 60,80 150,80 150,130", "60,180 60,130 150,130 150,180"
  13. Hemanth Kumar HJ

    Doubt in w3schools

    Hi, I have doubt in AJAX Database, In that getuser.php what should i write in the place of ajax_demo. Please anybody help me. And the link is http://www.w3schools.com/php/php_ajax_database.asp
  14. I have already created mysql table with data, this is my javascript code <SCRIPT language="JavaScript">function send_status(){var status;var Digital=new Date()var hours=Digital.getHours()if (hours>=6&&hours<8) //on timestatus = "onTime";else if (hours>=8) //late comersstatus = "late";window.alert(status);}$.ajax({type: "POST",url: "ajaxjs.php",data: status,cache: false,success: function(html) {alert(html);}});}return false;}</SCRIPT> im attempting to generate a value for user status from th above if command in js then send this string into my db using ajax which is pointing to my php page <?php// Fetching Values From URL$connection = mysql_connect("localhost", "CJroot", ""); $db = mysql_select_db("mysql_practice", $connection); if (isset($_POST['typeahead'])) {$query = mysql_query("UPDATE user_signin SET status='$status' WHERE user_name = '$typeahead')"); //Insert Queryecho "Form Submitted succesfully";}mysql_close($connection); ?> im not getting it right please any suggestions?
  15. I am trying to pass a variable from a javascript function to my php file. All I do is extract the user_name from a cookie in javascript and then use AJAX to $_POST the variable to my php file for processing. I do not use a form to submit the POST variable which I have done in the past.The problem is my $_POST array is not getting passed to the php file. I've looked here and looked at several other suggestions but none work. Do you have to submit the $_POST variable via an html form? I dont think so but maybe I'm wrong. Here is the code:Javascript - function clearDoneItems() { var user_name = getNameFromCookie(); if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } alert(user_name); xmlhttp.open("POST","todolist/clear_done_items.php",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(user_name); displayHomeInformation(user_name); } PHP - <!DOCTYPE html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>Clear Done Items</title> </head> <body> <?php ini_set('display_errors',1); error_reporting(E_ALL); print_r($_POST); $xml_name=$_POST['user_name']; $xml_file = $xml_name . ".xml"; echo $xml_file; /* Here we will use the The DOMDocument class functions to delete the text nodes. Format XML to save indented tree rather than one line */ $domxml = new DOMDocument('1.0'); if ($domxml->load('$xml_file') === TRUE) { $domxml->preserveWhiteSpace = false; $domxml->formatOutput = true; // Start Delete process of node echo "<br>"; $xpath = new DOMXPath($domxml); // Here we use the The DOMXPath class function evaluate to do the heavy lifting. foreach ($xpath->evaluate('//doneitems/item') as $node) { $node->parentNode->removeChild($node); } //Save XML to file - remove this and following line if save not desired $domxml->save('alan.xml'); echo "<strong>XML Document updated.</strong>"; } else { echo " <strong>Error in loading XML file:</strong>"; echo "<br>"; print_r(error_get_last()); } ?> </body> </html> >Errors on php page:Notice: Undefined index: user_name in /var/www/bb/todolist/clear_done_items.php on line 160Warning: DOMDocument::load(): I/O warning : failed to load external entity "/var/www/bb/todolist/$xml_file" in /var/www/bb/todolist/clear_done_items.php on line 24 I thought from reading up on AJAX the POST variable is set from the three commands xmlhttp.open,.setRequestHeader and .send. Dont these take the place of the POST action in an html form?
  16. Since some webpages of W3Schools discuss which browsers (e.g. Google Chrome, Internet Explorer) support certain features, I think that W3Schools should note in its jQuery AJAX tutorials that Google Chrome cannot be used to import files (e.g. .html files) from one's own hard drive, whereas Internet Explorer and Mozilla Firefox can. This would have saved me much time that I spent finding out the hard way, and based on other online forums, other people seem to be confused by Google Chrome's incompatibility and do not know the reason.
  17. Case Study 5 BrainChallange.zip
  18. when i select some thing in bill.php ,it ajax call and get value from get user.php then it display content on bill.php the page but how could i hold those value in a variable in bill.php page for further use in php bill.phpgetuser.php
  19. CoconutJJ

    AJAJ / PHP Multiple Append Problem

    I have a problem with the jQuery AJAX Append function. Everytime I append a comment to the <span>, not only does it append that single one, but also replicates every other comment dynamically generated by the PHP. So I end up with multiple repeated comments. However, the repeated comments aren't stored in the database, so whenever I refresh the page, it goes away. How can I prevent this without refreshing the page everytime? PHP: To display all comments <span id="commentHint"></span><?phpecho "<b>$comment_user said:</b><small>$comment_time</small><br>"; echo "$comment<br>";?> AJAX: Comment On Submit <script> $(document).ready(function () { var form = $('#form'); var submit = $('#submit'); form.on('submit', function (e) { // prevent default action e.preventDefault(); // send ajax request $.ajax({ url: 'commentpost.php', type: 'POST', cache: false, data: form.serialize(), beforeSend: function () { // change submit button value text and disabled it submit.val('Submitting...').attr('disabled', 'disabled'); }, success: function (data) { var item = data; $('#commentHint').append(item); //Appends it to div. form.trigger('reset'); submit.val('Submit Comment').removeAttr('disabled'); }, error: function (e) { alert(e); } }); }); });</script>
  20. Please Add the Petrojs Tutorial
  21. elcaiaimar

    reload script from ajax

    Hello, I'm trying to reload only a script instead of entire page. And I want to apply it in an ajax script. How could I do that? My web contains a map(script of openlayers) and I put data into the map. So when I remove this data by a button I would like reload only the map. Here is my code. It only shows an alert if the object has been removed or not: // Autor: @jqcaper// Configuraciones Generalesvar nombre_tabla_pozos = "#tabla_pozos"; // idvar nombre_boton_eliminar_pozo = ".deletepozo"; // Clasevar nombre_formulario_modal_pozo = "#frmEliminarpozo"; //idvar nombre_ventana_modal_pozo = "#pozoModal"; // id// Fin de configuraciones$(document).on('ready',function(){ $(nombre_boton_eliminar_pozo).on('click',function(e){ e.preventDefault(); var Pid_pozo = $(this).attr('id'); var name_pozo = $(this).data('name'); $('#modal_idPozo').val(Pid_pozo); $('#pozo_name').text(name_pozo); }); var options_pozo = { success:function(response) { if(response.status=="True"){ alert("¡Object removed!"); var idPozo = response.pozo_id; var elementospozo= $(nombre_tabla_pozos+' >tbody >tr').length; if(elementospozo==1){ location.reload(); }else{ $('#tr'+idPozo).remove(); $(nombre_ventana_modal_pozo).modal('hide'); } }else{ alert("¡There was an error when remove!"); $(nombre_ventana_modal_pozo).modal('hide'); **RELOAD SCRIPT }; } }; $(nombre_formulario_modal_pozo).ajaxForm(options_pozo);}); Thank you very much!
  22. supertwister

    URL control in Ajax

    Hi All,I'm developing a basic website and have a question. Hope it's not too much basic. I'm new in web stuff.I have the following code: $.ajax({url: '/blabla/yadayada'type: "get",success:function(data, testStatus, jqXHR){.........},error: function(jqXHR, testStatus, errorThrown){alert('error')}}); In addition, i have the following Python code: class AfCont(object):def __init__(self, target, context):self.target_server = targetself.context = contextself.baseContext = "/MyApp%s" % ( ("-" + self.context) if self.context else "")print "Starting %s with server: %s " % (self, self.target_server)def general_url(self, url_sfx):headers = {"Accept": "application/json"}params = Nonethe_url = "%s/%s" % (self.baseContext, url_sfx)print "%s %s %s " % (self, self.target_server, the_url)conn = httplib.HTTPConnection(self.target_server, "8080")conn.request("GET", the_url, params, headers)response = conn.getresponse()theResp = response.read()return theResp@cherrypy.exposedef bla_yada(self):htmlText = self.general_url("blabla/yadayada")return htmlText As you can see in the Ajax code, my URL is /blabla/yadayada. However, i need to send GET requests to /blabla/yadayada/number. I want to control the number part with a parameter. For example: number = 150 -- > `/blabla/yadayada/150`number = 9595-- > `/blabla/yadayada/9595` Can someone help me with that? Hope i was clear enough.
  23. Hello, I need delete row in html table select row and click button delete make delete using ajax Currentally can make delete without ajax but I need delete row and stay on page without make submit on other page code html,php <?php $resualt=mssql_query("SELECT * FROM Address where user_id='$UserId' ") ;echo "<table border='1' class='imagetable' id='imagetable'width='400px' >n";echo '<thead>'.'<tr>';echo '<th>Street</th>'.'<th>Quarter</th>'.'<th>From</th>'.'<th>To</th>'.'<th>Notes</th>';echo '</tr>'.'</thead>';echo '<tbody>';while ($row = mssql_fetch_assoc($resualt)) {$fromDate=$row['from_date'];$toDate=$row['to_date'];echo " <tr onClick='myPopup($row[id])'". ( $_GET['id'] == $row['id'] ? "style='background-color: green;'":"").">n"."<td >{$row['street']} </td>n"."<td>{$row['quarter']}</td>n"."<td>$fdate2</td>n"."<td>$tdate2</td>n"."<td>{$row['other_info']}</td>n";}echo '</tbody>';echo "</table>n";?> //button delete <?phpecho"<a class='button-link' href='delete_address.php?id=$id'>delete</a>"; ?> code sql to make delete from db <?php$idEmploye=$_GET['id'];$db_host = 'jo';$db_username = 'jo1';$db_password = '123321';$db_name = 'db_test';mssql_connect($db_host, $db_username, $db_password);mssql_select_db($db_name);mssql_query("DELETE FROM AddressWHERE id='$idEmploye' ; ") or die(mssql_error()) ;echo '<script language="javascript">';echo 'alert("successfully deleted ")';echo '</script>';echo "<script>setTimeout("location.href ='address.php';",10); </script>"; ?> Any Help Thanks
  24. function getXMLHttp(){ var xmlHttp; try { //Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch(e) { //Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("Your browser does not support AJAX!") return false; } } } return xmlHttp;}function populateEntries(menu, userName, entryRow){ var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if ((xmlHttp.readyState == 4) && (xmlHttp.status == 200) && (xmlHttp.responseText == "")) { window.alert("There are no records to view!"); } else if ((xmlHttp.readyState == 4) && (xmlHttp.status == 200)) { var response = xmlHttp.responseText;// window.alert("PHP Response = '"+response+"'"); } } xmlHttp.open("GET", "getUsers.php", true); xmlHttp.send(null);// ADDITIONAL UNRELATED CODE THAT PARSES THE “RESPONSE,” CREATING A MULTIDIMIENSIONAL ARRAY, WHICH POPULATES A SELECT INPUT FOLLOWS ....} I am using an AJAX call from a javascript to populate a SELECT input. This script is not working as shown in the code excerpt below. However, when I insert an alert of any type at the location shown by the comment, it works as planned. What could be causing this? I've also tried, without success, inserting a delay function after the AJAX call to allow time for the response to be returned (even with the readystate and status tests shown). Any suggestions as to how I can get this to work as desired?
×