You have to reproduce the functionality of the server side request to local js and call the corresponding function.
Example: let's say that you make an ajax requets to server and pass 2 parameters and server responds with the sum of them and also with an "element.update" statement to modify the HTML in your page. You will need to create a js function with same functionality (it is entirely possible) and when in offline mode don't do an ajax request to server, but directly call the js function with same functionality (sum the numbers and update the HTML). What I did on my heavy ajax site, I made a class (Server) and I don't direcly make ajax calls, I call my Server.call_function(functionName) and call_function will make an ajax request if server is available for named function or will call the offline version that was previous mapped. On Mar 28, 12:53 pm, Amit Kumar Verma <[email protected]> wrote: > Hi All, > > I am trying to make a prototype using google gear, and succeed in > database synchronization, capturing the files, css and scripts etx. I > want to use Single Page Layout where each request will be Ajax request > only. > > My problem is gear in not intercepting my ajax call when there is no > server [offline mode]. Basically when there is no server, we can't > make an ajax request and thus gear can't intercept that request. Do > there is any solution to this problem, means can't we make an dummy > ajax request which will be intercepted by gear. If this is not > possible then we can't implement Single page layout using gear !!??? > > Thanks > Amit Kuma Verma.
