Hi Remi,

Its pretty easy.

1. Create a page that subscribes to the online/offline event.
2 In the handler call a XMLHTTPRequest 
3. Leave the browser page open
4. Press the HOME button, go to settings, go to airplane mode
5. Go offline
6. Go Online
7. When you go online it will call yout XMLHTTPRequest

Regards,

Alon Raskin
e: aras...@go3i.com

-----Original Message-----
From: iphonewebdev@googlegroups.com [mailto:iphonewebdev@googlegroups.com] On 
Behalf Of Remi Grumeau ?
Sent: Sunday, January 16, 2011 4:01 AM
To: iphonewebdev@googlegroups.com
Subject: Re: Working with DB during online event - iPhone

I would have said "can't be done" so
#1. How do you do that?!
#2. There is a good chance that LocalDB connection is related / managed by a 
browser thread.

R

On 15 janv. 2011, at 02:19, Alon Raskin <aras...@go3i.com> wrote:

> Hi Everyone,
> 
> I know its a long shot but I wanted to see if anyone had any workarounds/tips 
> on how to fix the following:
> 
> I am trying to trigger some code when the user goes from offline to online. 
> The 'catch' is that the user may not even be in the browser. Here is the 
> scenario:
> 
> 1. User opens page
> 2. Leaving the page open, user navigates away from the browser while still 
> leaving the page open.
> 3. User goes offline (airplane mode)
> 4. Later user goes back online 
> 5. At that point, even if the browser is not on,I want to read a table in the 
> db and do some xmlhttprequest.
> 
> Before you say it can't be done I have almost got it working. I can update 
> the dom and make xmlhttprequest calls without having the browser open. The 
> only thing that doesn't seem to work is the Db reads. For some reason when 
> the online event is fired all the db calls fail. Not sure if it has to do 
> with the fact that the browser is running in a background thread and it won't 
> allow for any asynch processing. That makes sense except the xmlhttprequest 
> are also asynch and they work great.
> 
> Your thoughts/comments are appreciated.
> 
> Alon
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "iPhoneWebDev" group.
> To post to this group, send email to iphonewebdev@googlegroups.com.
> To unsubscribe from this group, send email to 
> iphonewebdev+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/iphonewebdev?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to iphonewebdev@googlegroups.com.
To unsubscribe from this group, send email to 
iphonewebdev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to iphonewebdev@googlegroups.com.
To unsubscribe from this group, send email to 
iphonewebdev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to