[Lift] Re: Asynchronous Javascript problem

2009-08-08 Thread Channing Walton
On Aug 7, 9:32 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I reproduced the issue on Opera... then Google banned my IP address for excessive requests... :-( they need to move to lift to handle the load ;) --~--~-~--~~~---~--~~ You received this

[Lift] Re: Asynchronous Javascript problem

2009-08-06 Thread Channing Walton
I've added a much simpler example too, see simple.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send

[Lift] Re: Asynchronous Javascript problem

2009-08-05 Thread Channing Walton
ok, lots of jscript debugging and I'm pretty sure its this: JSON.stringify(new GLatLng(0,0)) where GLatLng is a google map object. the imports needed for this are script src=http://maps.google.com/maps? file=apiamp;v=2.xamp;key=your-keyamp;sensor=false type=text/ javascript/script script

[Lift] Re: Asynchronous Javascript problem

2009-08-05 Thread Channing Walton
actually that example doesn't work in Opera, but does in safari and firefox. To see the problem in safari I had to modify the script like this: var geocoder = new GClientGeocoder(); geocoder.getLatLng(london,doit); function doit(point) { var s = JSON.stringify(point); alert(s) } This does

[Lift] Re: Asynchronous Javascript problem

2009-08-05 Thread Channing Walton
ok I've done that: git://github.com/channingwalton/lift_1_1_sample.git run the app up and go to http://localhost:8080/mapSearch and try the search. I find stack overflow in Safari 4.0.2, and Opera 9.64. The query works in Firefox 3.5.2 and Webkit Version 4.0.2 (5530.19, r46770) (latest nightly)

[Lift] Re: Asynchronous Javascript problem

2009-08-04 Thread Channing Walton
spoke too soon :-( when I test this on a new browser or flush browser caches, I am getting a javascript error: Undefined variable: JSON I am not wrapping my the input field in a json form as described in the book because when I do the page reloads. Could that be the problem? In which case how

[Lift] Re: Asynchronous Javascript problem

2009-08-04 Thread David Pollak
Are you including the /classpath/json.js JavaScript file? On Tue, Aug 4, 2009 at 1:15 AM, Channing Walton channingwal...@mac.comwrote: spoke too soon :-( when I test this on a new browser or flush browser caches, I am getting a javascript error: Undefined variable: JSON I am not wrapping

[Lift] Re: Asynchronous Javascript problem

2009-08-04 Thread Channing Walton
doh! I missed that. On Aug 4, 4:38 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Are you including the /classpath/json.js JavaScript file? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To

[Lift] Re: Asynchronous Javascript problem

2009-08-04 Thread Channing Walton
In Safari 4.0.2, and Opera 9.64 on OS X, I get RangeError: Maximum call stack size exceeded at line 27 in json.js But in the latest nightly build of webkit, it works. I will try on windows asap. --~--~-~--~~~---~--~~ You received this message because you are

[Lift] Re: Asynchronous Javascript problem

2009-08-04 Thread David Pollak
Please put together some simple code that reproduces the problem and I'll make it go away. On Tue, Aug 4, 2009 at 2:48 PM, Channing Walton channingwal...@mac.comwrote: In Safari 4.0.2, and Opera 9.64 on OS X, I get RangeError: Maximum call stack size exceeded at line 27 in json.js But in

[Lift] Re: Asynchronous Javascript problem

2009-08-02 Thread Channing Walton
On Aug 1, 8:50 pm, Channing Walton channingwal...@mac.com wrote: But I get a Can't find variable: JSON error. forget that, I was having some kind of safari issue. But the problem I am having now is a NumberFormatException: 2009-08-02 15:42:58,098 WARN lift:246 - Request for /ajax_request/

[Lift] Re: Asynchronous Javascript problem

2009-08-02 Thread David Pollak
Channing, We don't use the Scala JSON parsing stuff because it does not do well with very long JSON expressions (stack overflow problems). The parsing defects (which I've fixed and added tests for) are a result of some strong typing that Scala *should* be enforcing and is not (the compiler was

[Lift] Re: Asynchronous Javascript problem

2009-08-02 Thread Channing Walton
On Aug 2, 6:14 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Give it an hour and give it a try. Thanks for hanging with me through these defects. Thanks David, its much appreciated - on a Sunday too! --~--~-~--~~~---~--~~ You received this message

[Lift] Re: Asynchronous Javascript problem

2009-08-02 Thread Channing Walton
ok just caught up and tried again, this time I get: 2009-08-02 20:07:16,981 WARN lift:246 - Request for /ajax_request/ F1105202520287L3C/ failed For input string: (-~0) java.lang.NumberFormatException: For input string: (-~0) at java.lang.NumberFormatException.forInputString

[Lift] Re: Asynchronous Javascript problem

2009-08-02 Thread David Pollak
This is very odd because the very data set that you included is part of the tests for the JSON parser. Please delete ~/.m2/respository and do a clean build and see if it works. On Sun, Aug 2, 2009 at 12:09 PM, Channing Walton channingwal...@mac.comwrote: ok just caught up and tried again,

[Lift] Re: Asynchronous Javascript problem

2009-08-02 Thread Channing Walton
yup tried that and am still getting the same error. I presume I should be using the 1.1-SNAPSHOT? On Aug 2, 10:01 pm, David Pollak feeder.of.the.be...@gmail.com wrote: This is very odd because the very data set that you included is part of the tests for the JSON parser. Please delete

[Lift] Re: Asynchronous Javascript problem

2009-08-02 Thread Channing Walton
ah wait, I am not seeing the latest code changes you made in the snapshot source I just downloaded from the mvn repos. I will endeavour to figure out why. On Aug 2, 10:01 pm, David Pollak feeder.of.the.be...@gmail.com wrote: This is very odd because the very data set that you included is part

[Lift] Re: Asynchronous Javascript problem

2009-08-01 Thread Channing Walton
ok I am getting somewhere. Thanks for your patience, I'll write this up somewhere in case someone else needs a google map in a liftweb app. The functions being generated are good: function sendPointToServer(point) { F298945645192D4K({'command': 'setPoint', 'params':point}); } function

[Lift] Re: Asynchronous Javascript problem

2009-07-31 Thread David Pollak
On Thu, Jul 30, 2009 at 10:55 PM, Channing Walton channingwal...@mac.comwrote: Are you putting the result of: Script(Function(sendPointToServer, point, PointHandler.call(setPoint, JsVal(point Anywhere on your page? I believe so, the page has a snippet:

[Lift] Re: Asynchronous Javascript problem

2009-07-31 Thread Channing Walton
cool thanks, that did it. Google recommends running a script on unload, their example has: body onload=initialize() onunload=GUnload() I couldn't see any Unload function anyway, I guess it would be a useful thing to add? --~--~-~--~~~---~--~~ You received this

[Lift] Re: Asynchronous Javascript problem

2009-07-30 Thread Channing Walton
Excellent, thanks David. On Jul 30, 1:17 am, David Pollak feeder.of.the.be...@gmail.com wrote: You can put a little JavaScript on the page which contains a function that you can call... for example: define a JsonHandler: object PointHandler extends JsonHandler {   def apply(in: Any):

[Lift] Re: Asynchronous Javascript problem

2009-07-30 Thread Channing Walton
Hi, I had to replace JsVal(point) with JsVar(point), but when I run it up, I get ReferenceError: Can't find variable: F542198622797IUJ in the browser console. The function in the page looks like this: function sendPointToServer(point) { F542198622797IUJ({'command': 'setPoint',

[Lift] Re: Asynchronous Javascript problem

2009-07-30 Thread David Pollak
On Thu, Jul 30, 2009 at 1:51 PM, Channing Walton channingwal...@mac.comwrote: Hi, I had to replace JsVal(point) with JsVar(point), but when I run it up, I get ReferenceError: Can't find variable: F542198622797IUJ in the browser console. The function in the page looks like this: function

[Lift] Re: Asynchronous Javascript problem

2009-07-30 Thread Channing Walton
Are you putting the result of: Script(Function(sendPointToServer, point, PointHandler.call(setPoint, JsVal(point Anywhere on your page? I believe so, the page has a snippet: lift:mapSnippet.mapFunctions/ which looks like this: def mapFunctions(xhtml : NodeSeq) : NodeSeq = {

[Lift] Re: Asynchronous Javascript problem

2009-07-29 Thread David Pollak
You can put a little JavaScript on the page which contains a function that you can call... for example: define a JsonHandler: object PointHandler extends JsonHandler { def apply(in: Any): JsCmd = in match { case JsonCmd(setPoint, _, yourData, _) = /// do something with yourData