This code is working here:
var
f='[{"order_id":"033665136312108","order_no":"10000","order_no_iteration":"1","estimated_completion_date":"1211491800","other_contact_tel":"07710082629"},
{"order_id":"720448404212108","order_no":"10001","order_no_iteration":"1","estimated_completion_date":"1210894200","other_contact_tel":""},
{"order_id":"469387193612108","order_no":"10002","order_no_iteration":"1","estimated_completion_date":"1211491800","other_contact_tel":"07710082629"},
{"order_id":"951732217512108","order_no":"10003","order_no_iteration":"1","estimated_completion_date":"1211494500","other_contact_tel":"01902646547"},
{"order_id":"072491624712108","order_no":"10004","order_no_iteration":"1","estimated_completion_date":"1211494500","other_contact_tel":"01902754637"}]
';
eval("h="+f);
document.write(h);Outputing: [object Object],[object Object],[object Object],[object Object],[object Object] So check you code, its something wrong somewhere... On Feb 20, 6:05 pm, "meerkat" <[email protected]> wrote: > Hi, > Did as you suggested and get this result: > > Error: No valid data found. Data > was:[{"order_id":"033665136312108","order_no":"10000","order_no_iteration":" > 1","estimated_completion_date":"1211491800","other_contact_tel":"07710082629 > "},{"order_id":"720448404212108","order_no":"10001","order_no_iteration":"1" > ,"estimated_completion_date":"1210894200","other_contact_tel":""},{"order_id > ":"469387193612108","order_no":"10002","order_no_iteration":"1","estimated_c > ompletion_date":"1211491800","other_contact_tel":"07710082629"},{"order_id": > "951732217512108","order_no":"10003","order_no_iteration":"1","estimated_com > pletion_date":"1211494500","other_contact_tel":"01902 > 646547"},{"order_id":"072491624712108","order_no":"10004","order_no_iteratio > n":"1","estimated_completion_date":"1211494500","other_contact_tel":"01902 > 754637"}] > > The end bracket is there. Don't know what to do now...any more ideas? > Thanks, > Meerkat. > > > > > -----Original Message----- > > From: [email protected] [mailto:[email protected]] > > On Behalf Of Oblygre > > Sent: Friday, February 20, 2009 5:54 AM > > To: Gears Users > > Subject: [gears-users] Re: serverresponse > > > Test with a smaller dataset.... > > > On Feb 19, 9:00 pm, "meerkat" <[email protected]> wrote: > > > I don't think the bracket is missing from the end...my > > > json_encode.php(having to use this- provided- as client is using php4 > > and > > > can't use the built-in json_encode function) has: > > > if ($isList) > > > { > > > foreach ($a as $v) $result[] = json_encode($v); > > > return '[' . join(',', $result) . ']'; > > > } > > > > I only copied part of the result as there is too much data to display. I > > > think there is about 256 rows. > > > > Could something be truncating the result and thus meaning no end > bracket? > > > Meerkat. > > > > > -----Original Message----- > > > > From: [email protected] [mailto:gears- > > [email protected]] > > > > On Behalf Of Oblygre > > > > Sent: Thursday, February 19, 2009 6:14 PM > > > > To: Gears Users > > > > Subject: [gears-users] Re: serverresponse > > > > > There is missing on end bracket ] in you data.... > > > > Try to locate it. > > > > Here is the def:http://www.json.org/ > > > > > On Feb 19, 4:44 pm, "meerkat" <[email protected]> wrote: > > > > > In the catch statement which is now: > > > > > try > > > > > { > > > > > eval("dataarr="+message.body); > > > > > wp.sendMessage("Valid data found, start adding to local > > > > db"); > > > > > } > > > > > catch (ex) > > > > > { > > > > > wp.sendMessage("Error Tosca: No valid data found. Data > > > > > was:"+message.body,message.sender); > > > > > > I thought it looked valid data too.:-( > > > > > > > -----Original Message----- > > > > > > From: [email protected] [mailto:gears- > > > > [email protected]] > > > > > > On Behalf Of Oblygre > > > > > > Sent: Thursday, February 19, 2009 2:08 PM > > > > > > To: Gears Users > > > > > > Subject: [gears-users] Re: serverresponse > > > > > > > You data look valid. > > > > > > Where is you wp.sendMessage located which shows this message? > > > > > > and did you fix this (shown under) as described earlier? If its > > coming > > > > > > from this, I understand, otherwise I don't have a clue. > > > > > > **from Feb 18, 8:31 pm ******************** > > > > > > And here, no error but a wrong feedback to the user: > > > > > > eval("dataarr="+serverresponse); > > > > > > wp.sendMessage("Error: No valid data found. Data > > > > > > was:"+serverresponse,message.sender); //This line is only > > executed if > > > > > > the eval goes ok, so it should return some ok status like "Valid > > data > > > > > > found, start adding to local db" > > > > > > ********************** > > > > > > On Feb 19, 10:21 am, "meerkat" <[email protected]> wrote: > > > > > > > Hello, > > > > > > > Now getting the message: > > > > > > > Error: No valid data found. Data > > > was:[{"order_id":"033665136312108","order_no":"10000","order_no_iteration" > > > > > > :" > > > 1","estimated_completion_date":"1211491800","other_contact_tel":"077100826 > > > > > > 29 > > > "},{"order_id":"720448404212108","order_no":"10001","order_no_iteration":" > > > > > > 1" > > > > > > > ,"estimated_completion_date":"1210894200","other_contact_tel":"" > > },{" > > > > orde > > > > > > r_id > > > ":"469387193612108","order_no":"10002","order_no_iteration":"1","estimated > > > > > > _c > > > > > > > ompletion_date":"1211491800","other_contact_tel":"07710082629"} > > > > > > > > What do I need to do to make data valid? > > > > > > > Thanks, meerkat. > > > > > > > > > -----Original Message----- > > > > > > > > From: [email protected] [mailto:gears- > > > > > > [email protected]] > > > > > > > > On Behalf Of Oblygre > > > > > > > > Sent: Thursday, February 19, 2009 6:45 AM > > > > > > > > To: Gears Users > > > > > > > > Subject: [gears-users] Re: serverresponse > > > > > > > > > You can remove the if(1) construct, it dosen't do anything.... > > > > > > > > > try change > > > > > > > > wp.sendMessage("Error in workerPool: > > "+errorObject.message+" on > > > > > > > > line"+errorObject.lineNumber,message.sender); And get " > > message > > > > is > > > > > > > > not > > > > > > > > defined" > > > > > > > > to > > > > > > > > wp.sendMessage("Error in workerPool",message.sender); > > > > > > > > > Im my last response I asked to you remove the serverresponse > > and > > > > > > > > replace with message.body > > > > > > > > Try that > > > > > > > > > On Feb 18, 10:58 pm, "meerkat" <[email protected]> wrote: > > > > > > > > > Tried wp.sendMessage("Error in workerPool: > > > > > > "+errorObject.message+" on > > > > > > > > > line"+errorObject.lineNumber,message.sender); And get " > > message > > > > is > > > > > > not > > > > > > > > > defined" > > > > > > > > > Still get "serverresponse is not defined" in- > > > > > > > > > catch (ex) > > > > > > > > > { > > > > > > > > > wp.sendMessage("Error: No valid data found. Data > > > > > > > > > was:"+serverresponse,message.sender); > > > > > > > > > > return; > > > > > > > > > } > > > > > > > > > Thanks. > > > > > > > > > > What is if(1) testing by the way? > > > > > > > > > > > -----Original Message----- > > > > > > > > > > From: [email protected] [mailto:gears- > > > > > > > > [email protected]] > > > > > > > > > > On Behalf Of Oblygre > > > > > > > > > > Sent: Wednesday, February 18, 2009 9:19 PM > > > > > > > > > > To: Gears Users > > > > > > > > > > Subject: [gears-users] Re: serverresponse > > > > > > > > > > > Replace your > > > > > > > > > > alert("Error in workerPool: "+errorObject.message+" on > > > > > > > > > > line"+errorObject.lineNumber); > > > > > > > > > > with > > > > > > > > > > wp.sendMessage("Error in workerPool: > > > > "+errorObject.message+" on > > > > > > > > > > line"+errorObject.lineNumber,message.sender); > > > > > > > > > > > The next I don't understand, but we can try > > > > > > > > > > commenting out > > > > > > > > > > // var serverresponse= message.body; > > > > > > > > > > and > > > > > > > > > > try change > > > > > > > > > > eval("dataarr="+serverresponse); > > > > > > > > > > to > > > > > > > > > > eval("dataarr="+message.body); > > > > > > > > > > > Another thing: > > > > > > > > > > The > > > > > > > > > > if (1) > > > > > > > > > > { > > > > > > > > > > construct can be removed... > > > > > > > > > > > Br > > > > > > > > > > > Olav > > > > > > > > > > On Feb 18, 9:43 pm, "meerkat" <[email protected]> wrote: > > > > > > > > > > > Thanks Olav for taking the time to help me. > > > > > > > > > > > I now have 2 errors in databaseworker.js: > > > > > > > > > > > "alert is not defined" at- > > > > > > > > > > > wp.onerror = function(errorObject) > > > > > > > > > > > { > > > > > > > > > > > alert("Error in workerPool: > > > > "+errorObject.message+" on > > > > > > > > > > > line"+errorObject.lineNumber); > > > > > > > > > > > }; > > > > > > > > > > > > And: "serverresponse is not defined" at - > > > > > > > > > > > catch (ex) > > > > > > > > > > > { > > > > > > > > > > > wp.sendMessage("Error: No valid data found. > > Data > > > > > > > > > > > was:"+serverresponse,message.sender); > > > > > > > > > > > > return; > > > > > > > > > > > } > > > > > > > > > > > > What should I change? > > > > > > > > > > > meerkat > > > > > > > > > > > > > -----Original Message----- > > > > > > > > > > > > From: [email protected] [mailto:gears- > > > > > > > > > > [email protected]] > > > > > > > > > > > > On Behalf Of Oblygre > > > > > > > > > > > > Sent: Wednesday, February 18, 2009 7:32 PM > > > > > > > > > > > > To: Gears Users > > > > > > > > > > > > Subject: [gears-users] Re: serverresponse > > > > > > > > > > > > > A quick answer: > > > > > > > > > > > > In databaseworker.js: > > > > > > > > > > > > What is ex.message? I think your error is here: > > > > > > > > > > > > line: wp.sendMessage(ex.message,message.sender); > > > > > > > > > > > > Try replace this line with > > > > > > > > > > > > wp.sendMessage("Error: No valid data found. Data > > > > > > > > > > > > was:"+serverresponse,message.sender); > > > > > > > > > > > > > And here, no error but a wrong feedback to the user: > > > > > > > > > > > > eval("dataarr="+serverresponse); > > > > > > > > > > > > wp.sendMessage("Error: No valid data found. Data > > > > > > > > > > > > was:"+serverresponse,message.sender); //This line is > > only > > > > > > > > executed if > > > > > > > > > > > > the eval goes ok, so it should return some ok status > > like > > > > > > "Valid > > > > > > > > data > > > > > > > > > > > > found, start adding to local db" > > > > > > > > > > > > > Try and report back... > > > > > > > > > > > > > Sorry for my late reply, I been very busy lately... > > > > > > > > > > > > > Olav > > > > > > > > > > > > > On Feb 18, 2:23 pm, "meerkat" <[email protected]> > wrote: > > > > > > > > > > > > > Have you had a chance to look at the serverresponse > > code > > > > > yet? > > > > > > I > > > > > > > > am > > ... > > read more »
