ajax problem (apparently only in firefox)

  • danmerrino
  • Novice
  • Novice
  • danmerrino
  • Posts: 21

Post 3+ Months Ago

hello friendly fellow nerds,...

i have the following problem:

i have js function that gets called by clicking a link.

this function then sends an assincronious (however you spell that) POST request to a php file which writes some data into a db. once this is done, so when connection.readyState==4 and connection.status==200, another function gets called, which ensures that another part of the page is updated according to the data written into the db. Thats why it gets called only when the other function has finished (so when the data is in the db).

the second function works by making the same kind of request (using the same xmlhttprequest object) but to a different php file. this file then changes a piece of code according to the new db entries and after all is done the new code is displayed in a certain other part of the same page. (it is not an option to change the code with js).

the problem is, that once the first function is done (so when connection.readyState==4 and connections.status==200) it calls the second function over and over again like in an infinite loop.

could this have something to do with the readyState of the xmlhttprequest object being set to 4 when the connection of the second function is opened? or something else with the xmlhttprequest?

i am completely lost at the moment please help....:(
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • danmerrino
  • Novice
  • Novice
  • danmerrino
  • Posts: 21

Post 3+ Months Ago

well i solved the problem by recreating the xmlhttprequest object at the beginning of the second function... doesnt feel very elegant but oh well....if any anybody figures this out please post anyway
have a pleasant and productive day.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: Liamw411 and 61 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.