i have a chat room created using php/mysql im using ajax to refresh with a javascript timeout displaying in a div

the problem im having is i cant break out of the refreshing div

if i use php header to change the location it stays within the div
if i use meta it doesnt work

    If you mean that you are trying to do a redirect via the output from the server-side script called by the JavaScript AJAX request, I do not believe that is possible. You would instead have to send some header or message that the AJAX response function could detect, and if so then do a document.location() call.

    If you mean something else (which I suspect might be the case), then we (or at least I) will need a more complete description of what the issue is.

      basically I have server-side code page that is refreshed periodically with an included script that catches errors and changes the location of the page if needed which i use to use a meta tag for.

      problem is with ajax and the div that doesnt work. it works if i load the page alone not in the div using ajax. it works if i use php header but again only in the div not the whole page as i would like it to.

        You could check the "status" property of your XMLHttpRequest object, and if it is "302" then either directly request that redirect page via a separate AJAX request, or if the redirect could be to one of several pages, then parse the "statusText" property of the object to figure out what page should be accessed.

          hmm
          thanks for the reply i will be looking into it and will post later.

            Write a Reply...