Ah. You posted your reply before I posted my second one. ignore it. Maybe just redirect the whole page if the login page is needed?
Like document.location.href="hey_you_need_to_log_in.html"; or somesuch? On Jul 25, 9:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Actually, looking over that w3schools page again, I just noticed that > they have an example page showing how to "Load a textfile into a div > element with XML HTTP (JavaScript)" which is pretty close to what > you've described. > > http://www.w3schools.com/xml/tryit.asp?filename=try_xmlhttprequest_js1 > > Cheers, > Robert. > > On Jul 25, 9:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > There are a few ways to do this. I'm not sure how it will work in > > iPhone, since I don't have one, but it should be fine. > > > The basic idea here is to use an XMLHTTPRequest object. You can then > > parse the data as needed, or massage it into whatever format you need. > > Once your data is prepped, you can populate your div. > > > You might also be able to have the second page pre-loaded as a string > > or whatever (maybe in a separate .js file) and then load your div > > based on that. That's less elegant and eats more memory, but it may be > > quicker to code. I don't think it will be noticeably quicker than the > > XMLHTTPRequest method at runtime. > > > More info about the XMLHTTPRequest object can be found at > > w3schools:http://www.w3schools.com/dom/dom_http.asp > > > Hand-dandy Google > > link:http://www.google.com/search?q=javascript+http+request > > > On Jul 25, 7:51 pm, "Jim Coates" <[EMAIL PROTECTED]> wrote: > > > > Hey all, > > > > I've got a scenario where some code is processed as part of an AJAX call > > > for > > > an iPhone app I am working on. > > > > This page would normally return text (which is inside of a DIV container), > > > but under certain circumstances I need it to be able to redirect the > > > entire > > > web site. > > > > I can't seem to figure out how to make this work. > > > > Here's the basic idea: > > > > MAIN PAGE calls SECOND PAGE via AJAX and loads inside of a div > > > > As second page is loading, it is checking criteria for the user. > > > If there is an error with the criteria, I want to redirect the entire site > > > to what equates to a log in page for the user. > > > > Any ideas? > > > > Thanks, > > > Jim Coates --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en -~----------~----~----~----~------~----~------~--~---
