Getting a number from JavaScript

Hey there

Is there a way to transfer a result obtained through Javascript to Xojo? For example, by using ExecuteJavaScript, I would like to be able to obtain the result from the JavaScript command: window.pageYOffset and transfer the result to a variable.

Thanks

Rick

[quote=135981:@Richard Hille]Hey there

Is there a way to transfer a result obtained through Javascript to Xojo? For example, by using ExecuteJavaScript, I would like to be able to obtain the result from the JavaScript command: window.pageYOffset and transfer the result to a variable.
[/quote]

Look at WebSDK.

Thank you for your quick response

I looked at WebSDK, but I could not find any examples relating to my question. I probably missed it… could you provide a more detailed answer or maybe which section I should look at? Being new to Web programming, an example would also be greatly appreciated.

Thanks again

Rick

[quote=135986:@Richard Hille]Thank you for your quick response

I looked at WebSDK, but I could not find any examples relating to my question. I probably missed it… could you provide a more detailed answer or maybe which section I should look at? Being new to Web programming, an example would also be greatly appreciated. [/quote]

The proper documentation for WebSDK is in the Extras folder, next to the Xojo IDE executable. Read WebControlSDK.pdf.

Alternatively, you can set the page hashtag, and get that value through the session HashTagChanged event.

JavaScript example :

ExecuteJavaScript(" window.location.replace('#'+'mystring'); ")