473,399 Members | 2,858 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,399 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 4460
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
it’s 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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.