| | |
Ajax help please...
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2009
Posts: 2
Reputation:
Solved Threads: 0
I'm a newbie in programming.
I spent few hours yesterday and today working on a small AJAX page with multiple combo boxes that are populated from the database. I use IE6 99% of the time and I utilize the excellent . I almost done with the page (I’m pretty proud of it too) so I decided to show it to my work buddy. On both IE8 and opera, my beautiful double combo boxes just failed miserably. A part of what I was doing was to populate a double combo box with dynamic data from the database. I created an empty SELECT tag (dynamically via JS), assigned its an ID, made an AJAX request, then populated the empty SELECT tag via the innerHTML with the AJAX response, which is a list of OPTION elements. On IE6, the double combo works so well that I thought it was time wrap up the project. However, on other browsers, the combo box just mysteriously failed to get populated.
First of all, I tried to eliminiate the possibility of my AJAX requests got messed up somewhere. I traced through the flow of the functions and put alert() to assert the responses of the AJAX requests.Everything works fine except the second combo.
Here's the ajax code..
Any Kind of help will be appreciated..
Thanks in advance..
I spent few hours yesterday and today working on a small AJAX page with multiple combo boxes that are populated from the database. I use IE6 99% of the time and I utilize the excellent . I almost done with the page (I’m pretty proud of it too) so I decided to show it to my work buddy. On both IE8 and opera, my beautiful double combo boxes just failed miserably. A part of what I was doing was to populate a double combo box with dynamic data from the database. I created an empty SELECT tag (dynamically via JS), assigned its an ID, made an AJAX request, then populated the empty SELECT tag via the innerHTML with the AJAX response, which is a list of OPTION elements. On IE6, the double combo works so well that I thought it was time wrap up the project. However, on other browsers, the combo box just mysteriously failed to get populated.
First of all, I tried to eliminiate the possibility of my AJAX requests got messed up somewhere. I traced through the flow of the functions and put alert() to assert the responses of the AJAX requests.Everything works fine except the second combo.
Here's the ajax code..
javascript Syntax (Toggle Plain Text)
function selected() { //alert("entered in function"); var xmlHttp; var str = document.form1.coursename.value; var bname = navigator.appName; var vname = bname + navigator.appVersion; alert(str); try { //alert(vname); //explorer 7+,firefox,safari,chrome,opera and others xmlHttp = new XMLHttpRequest(); } catch(e)//for IE { try { //alert("ie6"); //for explorer 6.0 xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { //alert("ie>6"); //explorer > 6 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { //explorer < 4 alert("Ajax is not supported by your browser"); } } } xmlHttp.onreadystatechange = function() {alert("entered in state changed"); if(xmlHttp.readystate == 4) { document.getElementById("subjectplace").innerHTML = xmlHttp.responseText;//subjectplace is the id of div tag alert("readystate=4"); } } xmlHttp.open("get","mypage.php?q="+str,true); xmlHttp.send(null); }
Any Kind of help will be appreciated..
Thanks in advance..
Last edited by Ezzaral; Sep 9th, 2009 at 1:34 pm. Reason: Added [code] [/code] tags. Please use them to format any code that you post.
![]() |
Similar Threads
- News Story: It’s Like AJAX for Ruby and Python (Ruby)
- Roblox seeks Web Developer – .NET / Ajax or DHTML (Web Development Job Offers)
- JavaScript / AJAX Guru (Software Development Job Offers)
- AJAX & PHP Developer ( Full Time ) (Web Development Job Offers)
- AJAX : Am i right with the concept? (JavaScript / DHTML / AJAX)
- News Story: Atlas is dead: long live ASP.NET 2.0 AJAX Extensions... (ASP.NET)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: ajax access pc mobile
- Next Thread: Javascript for an online quiz...
| Thread Tools | Search this Thread |
Tag cloud for ajax, ajaxcode, ajaxexample, ajaxhelp, codes, javascript, php, programming, software
adobe ajax api apple applicationreengineering array asp beta blog blogging browser business c# c++ cart cms code css data database desktop developer development display download email file firefox flash form forms free fsf functions games gaming gdata gnu google hardware html ie8 iframe include intel internet iphone java javascript jquery linux login mac mail malware mcafee microsoft mobile msdn music mysql news office open openoffice opensource os outsourcing paypal pdf php piracy post problem programming python query rss script search security server shopping sms software softwaredevelopment spyware sql stallman systemintegration upload validation video vista vulnerability web wiki windows windows7 xml






