Timed events using Ajax techniques

Munguti

Munguti

@munguti-MnxkmE Oct 17, 2024
Guys I am using ajax techniques to read a text file from my computer using apache server. This text file is periodically edited during while the client is browsing and i have developed code that could refresh without clicking i.e. ajax technique. the problem is that after a few edits usually one the text seems to be read from some other place i.e. the contents displayed are those of a previous instance and not the current text from the file specified in the html code.😕
This persists even after closing the browser and restarting the computer/and or the apache server. its is only after i have run my tuneup utilities that i am able to see the currents files text.
Any help will be appreciated.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • shalini_goel14

    shalini_goel14

    @shalini-goel14-ASmC2J Jun 17, 2009

    Hi Munguti,

    I guess your current problem states that there is some problem in the paths that you would have provided. This could be a reason that it is reading text from some other place. Can you show us your code(if possible) -what exactly you are trying to do? May be we can be of some help. 😀
  • Munguti

    Munguti

    @munguti-MnxkmE Jun 17, 2009

    I will upload the code later on, I am not in a position to do so right now. Anyway it cannot be the path since the text being displayed is the one the text document had previously but was edited.

    I am trying to do a chat like update using text documents instead of XML, the text document has it's data changed periodically as the client is browsing, the browser should change its display depending on the current content of the text file. The problem is that the browser will change the text then after a while will stop reading the current text and will always be displaying the previous text, maybe its because it may be caching the text, if that is the case i might need guidance on how to stop this cahing.

    Is using a text file the best approach.(The data is in text since it is not that complicated).
  • shalini_goel14

    shalini_goel14

    @shalini-goel14-ASmC2J Jun 18, 2009

    Hi Munguti,

    Cannot say anything without looking at code. Are you talking about clearing browser cache? What and how exactly you are doing or reading text from files? What kind of editing you are doing?
  • Munguti

    Munguti

    @munguti-MnxkmE Jun 21, 2009

    Sorry i didn't reply on time, i have been trying too hard to hack the code but i couldn't. I tried to block the browser from caching the response but i couldn't.
    Anyways i stopped sending my request to a text document, now i am sending them to a php script which reads the text document and it has worked fine, it's real time as i wanted it.
  • Munguti

    Munguti

    @munguti-MnxkmE Jun 21, 2009

    Thank you shalini
  • CEMember

    CEMember

    @cemember-PlqlWH Jul 2, 2009

    Munguti
    Sorry i didn't reply on time, i have been trying too hard to hack the code but i couldn't. I tried to block the browser from caching the response but i couldn't.
    Anyways i stopped sending my request to a text document, now i am sending them to a php script which reads the text document and it has worked fine, it's real time as i wanted it.
    Hi Munguti,

    Can you please explain your exact problem along with solution here? We all can get benefit from it. 😀

    Thanks !