CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Posts
    115

    refresh page flicker

    How can I make a part of the page or the page itself refresh without any of that flickering so it refreshes smoothly?

  2. #2
    Join Date
    May 2004
    Location
    MN / NJ, United States
    Posts
    768

    Re: refresh page flicker

    When you click the browser refresh button, it has built in code that is in the program or operating system or whatever. You can't control what that code does and if it causes a flicker or not.

    By "smoothly," exactly what do you mean because there still could be a workaround.
    *9-11-01* Never Forget; Never Forgive; Never Relent!
    "If we ever forget that we're one nation under God, then we will be a nation gone under." - Ronald Reagan

  3. #3
    Join Date
    Jun 2005
    Posts
    115

    Re: refresh page flicker

    well im working on a online php rpg and there is a grid where the character is and the tiles ect im going to be using javascript for movement with the arrow keys wich is easy the only thing i do not know is how to have that grid just update i know how to do it with php but it wouldnt refresh smoothly it would take some time. I have seen ajax examples that work like a charm but i dont know how its done exactly and im trying to learn ajax to figure it out but maybe theres a simpler way?

  4. #4
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: refresh page flicker

    Well - "Ajax" uses javascript to update parts of the page so it doesn't have to be posted back to the server. It is unfortunally a rather vast topic so I'll not go into the workings of it (besides many webpages or CG-users explain it much better then me), but the basic technique is realtive simple.

    Basically what happens is that behind the scenes in your javascript you send a request (XMLHttpRequest) to the server. The server does the work based on the request and replies with a response. This response gets delivered to your javascript which you then handle and update the page depending on the content.

    Because all pageupdate is made using the javascript, it is all made clientside. That is how you can "refresh" the page withouth "flicker".
    This holds several advantages, for instance the traffic between the client and the server is less then if the whole page needed to be submitted back and forth all the time. It makes the page seem much more responsive to the user - much more application like. And so on....
    It also holds several disadvantages, amongst others that you risk a great deal of the buisness logic being placed at the client in plain(-ish) view of the person viewing the page, and it can be quite extensive working with the DOM-tree if you need to update large parts of the page. Thus depending on situation it is best to mix Ajax techniques with "regular" web-techniques.

    As said the basics of Ajax is relative simple and there are a ton of webpages out there which shows you the 2-3 javascript functions needed to make and handle the request/response.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured