Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nownot

macrumors regular
Original poster
Feb 25, 2007
245
1
tx
I have a page that once a radio button is clicked it calls a javascript function to see if there is a password needed to select that item. The js calls a JSON -> php which hits my db and returns the pass. It works in all browsers except for ie7 and ie8 <- ( i think haven't tested ie8 yet ), and I cant figure out why. My code is http://pastie.org/433970 and an example of the page is http://173.57.59.9:8080/wp-content/test_sites/robocamp/testradio.html . If anyone could help me with this I would forever be in your debt, thanks.
 
I don't have IE access at the moment. Are there any errors messages, or have you debugged to a certain part of the code not working? Also, did you test IE6?
 
no error messages, and no i havent tested w/ ie6 but will once i go to class. the bug seems to be the json part, not completely sure, kinda new to js.
 
I'm going to make some blind suggestions. Try moving your request.open and request.send lines after the request.onreadystatechange block. Order can matter at times. Also, looking at my own AJAX method that I have, after checking the readyState you should also check the status (which should be 200), so you would have,
PHP:
if(request.readyState == 4 && request.status == 200){
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.