Hey guys,
Im having the weirdest problems with my ajax. Now first off i have horrible coding convention!! I have one Ajax.js file which handles all my ajax requests and one ajax.php file which handles retrieving data from a database.
The problem I am having is when ever I call a certain method which contains a if statement and runs the respective ajax function, it sometimes evaluates the if statement wrong. The weirdest thing of all is when I use FireFox's firebug and step through the javascript code to see why its evaluating the if statement wrong, it evaluates it correctly.
So basically if I don't step through the javascript code it evaluates the if statement wrong which means one of my variables are not being set in time for it to be used in the if statement. BUT if i step through the code with firebug it evaluates the if statement correctly!!!!!!
Now I have tried this is all the browsers and sometimes it evaluates the if statement correctly and when i keep refreshing the page it will sometimes evaluate the if statement correctly!!!!
Now I know this makes no sense, but I'm just as confused! The only reason I can think why this is happening is that one of my variables are not being set in time for the if statement to use it!!
Can anyone help me pleeeeaaassee!!! ITS DRIVING ME INSANE!!!!