473,222 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,222 software developers and data experts.

simple ajax works in chrome and FF but not IE

This code works in Chrome and pulls a second drop down, but it will not work in IE6, (I dont have IE7/8 to check right now, but can later) and it works in FF, in IE it doesn't do anything at all.

Thanks for any help!

php code to push data to page:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $q=$_GET["q"]; //number
  3. $blown = explode(',',$q);
  4. $q = $blown[0];
  5. $appl = $blown[1];
  6.  
  7. include "/home/advent1/public_html/secure/connect.php";
  8. $clients= "'$_SESSION[group2]'";
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. ?>
  16.  
  17. <select name="lookupanswers">
  18. <option></option>
  19. <?php
  20. $i=1;
  21. while ($i <= '10') {
  22. $p="appl_quest{$i}_yn";
  23. $m="appl_drop_{$q}_{$i}";
  24. $n="quest{$i}_yn";
  25. $sqlappl = "SELECT appl from client_table where appl = {$blown[1]}";
  26. $resultappl = mysql_query($sqlappl) or die(mysql_error());
  27. $appl = mysql_result($resultappl, 0);
  28.  
  29. $sqlapplquest = "select {$m} from lookup_table where appl = {$appl}";
  30. $resultapplquest = mysql_query($sqlapplquest) or die(mysql_error());
  31. $applquest = mysql_result($resultapplquest, 0);
  32.  
  33. if ($applquest == '') {
  34. } else { 
  35. ?>
  36. <option value="<?php echo $i; ?>"><?php echo $applquest; ?></option>
  37. <?php
  38. }
  39. $i++;
  40. }
  41. echo $sqlapplquest;
  42. ?>
Javascript code to make the ajax object.
Expand|Select|Wrap|Line Numbers
  1. var xmlhttp;
  2.  
  3. function showUser(str,appl)
  4. {
  5. xmlhttp=GetXmlHttpObject();
  6. if (xmlhttp==null)
  7.   {
  8.   alert ("Browser does not support HTTP Request");
  9.   return;
  10.   }
  11. var url="getanswer.php";
  12. url=url+"?q="+str;
  13. url=url+"&sid="+Math.random();
  14. xmlhttp.onreadystatechange=stateChanged;
  15. xmlhttp.open("GET",url,true);
  16. xmlhttp.send(null);
  17. }
  18.  
  19. function stateChanged()
  20. {
  21. if (xmlhttp.readyState==4)
  22. {
  23. document.getElementById("txtAnswers").innerHTML=xmlhttp.responseText;
  24. }
  25. }
  26.  
  27. function GetXmlHttpObject()
  28. {
  29. if (window.XMLHttpRequest)
  30.   {
  31.   // code for IE7+, Firefox, Chrome, Opera, Safari
  32.   return new XMLHttpRequest();
  33.   }
  34. if (window.ActiveXObject)
  35.   {
  36.   // code for IE6, IE5
  37.   return new ActiveXObject("Microsoft.XMLHTTP");
  38.   }
  39. return null;
  40. }
part of page its supposed to be updating.
Expand|Select|Wrap|Line Numbers
  1. Question:
  2. <select name="lookups" onchange="showUser(this.value)">
  3. <option></option>
  4. <?php
  5. $i = '1';
  6. while ($i<'10') {
  7. $sqlapplquest = "select appl_drop_{$i} from appl_table where appl = {$appl}";
  8. $resultapplquest = mysql_query($sqlapplquest) or die(mysql_error());
  9. $applquest = mysql_result($resultapplquest, 0);
  10.  
  11. if ($applquest != '') {
  12. ?>
  13. <option value="<?php echo $i; ?>,<?php echo $appl; ?>">  <?php echo $applquest; ?>  </option>
  14. <?php
  15. }
  16. $i++;
  17. }
  18. ?>
  19. </select> Answered:<d id="txtAnswers"><select></select></d>
Thanks again!
Sep 20 '09 #1
6 4453
found the problem, <d> isn't supported in IE6...thanks guys.
Sep 20 '09 #2
Plater
7,872 Expert 4TB
What IS "<d>"?
I do not see it listed here:
http://www.w3schools.com/tags/default.asp
Sep 23 '09 #3
Dormilich
8,658 Expert Mod 8TB
its also not listed here http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
Sep 23 '09 #4
Its sloppy at best, but i ran outta other tags that i could use there, div kept putting it on the line under.

Its cool, no worries, its really not what ANYONE should use, and i'm not defending it. but it DID work in FF and Chrome, and not in IE, and that should be pointed out. Thats all.
Sep 25 '09 #5
Plater
7,872 Expert 4TB
Did you try a <span>? Div is a block element, Span is in-line
Sep 25 '09 #6
rnd me
427 Expert 256MB
@oneadvent
it will work, as in stuff will show up, but it doesn't respond to CSS tag selectors, or have as many dom bindings like lang and name.

this should be fixed in the next version of IE.
Sep 28 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: dondraper | last post by:
I have an application that uses a popular but simple set of JavaScript routines that implement an AJAX call used to populate a drop-down. It works for thousands of user but I have one customer...
7
by: Ivan Marsh | last post by:
Hey Folks, I'm having a heck of a time wrapping mind around AJAX. Anyone know of a simple, straight-forward example for pulling a simple query from mysql with PHP using AJAX? As I...
1
by: www.web20developers.com | last post by:
http://www.web20developers.com http://www.web20developers.com/index.php?option=com_content&task=view... Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell AJAX -...
2
by: brakai295 | last post by:
Hi there, I need someone to customise an autocompletion AJAX script a little bit. This free script here (demo | info & download) offers you auto-completion when typing in a country's name. I...
15
by: moltendorf | last post by:
I have created a little chat application that seems to work 100% on Mozilla Firefox, Google Chrome, and Safari, (tried it in Opera, and it seems to work, but the cookies are screwing everything up;...
7
by: mike57 | last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers. ...
3
by: fkhowaja | last post by:
i want to show the property details and there status (APPROVED, REJECTED, PENDING) the whole result is coming through ajax now i want that if i click on Approved icon or Pending icon or Rejected icon...
5
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
21
by: bennettj | last post by:
Hello i'm relatively new to web programming and i have been giving the task of moving one of my VB programs over to a web format. I generally use google chrome and that has been what i've been...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.