Can I use a javascript library e.g. for xmpp communications ( strophe.js ) with xojo ? I tried to put some script functions in a pagesource but
I only get the “html” parts displayed on the page but no javascript things. I tried it with alert … . If I put the html-script as test.html on a web page it worked.
are there any documentations or samples how to use javascript, library and callbacks ? ( with exception “executeJavaScript” ? )
Have you guys read the WebControlSDK document in the …/Extras/WebSDK folder?
It has got some nice examples on how to build custom web controls, and on page 20 there is a short description about the “Xojo.loadScript” function that can be used to dynamically load JavaScript scripts into your applciation.
new webproject
new class
super webcontrolwrapper
–> cannot change name from class1 to … it always switch back to class1 ! so I worked with class1
2) Several problems a the computed property and warnings on the javascriptnamespace
ControlAvailableInBrowser() does not exists
me.* does not mean anything with this method
javascriptnamespace is alrady defined
…
I’am on MAC 10.8.3. Did this sample works for anybody ?
I don’t get an error, if i save the project he switches back to class1. And it is not always, after playing with save edit change value of super and back, but I found not a clear way to workaround …
it sometimes works
You cannot upload a local file. Upload it somewhere on the web and link to it. There are plenty of file hosting services. Better still, attach them to a Feedback report so Xojo will be sure to see it.
Shared Properties and Methods don’t have an Instance connected to them. Without that ControlAvailableInBrowser (and the following Me statement) have no meaning.
Ok, Thank’s, I only try to follow the First Sample in the webSDK document. I should convert the html in a Computed property and Paste this Code in the setter . So i tried to get this Running
That’s strange, I certainly do. Remember though, you can only call LoadLibraries from within the control or one of its subclasses. It will not work from an instance that has been placed on a WebPage.
I have found that I can also load a library from the app.htmlheader. but where is the difference and
how can I get the callbacks ? In the library I get a callback from “onConnect” but I have no idea how I could
get them in an Xojo webapplication.
The callback happens on the client side. if you want the event to come back to the server, you’d need to do that yourself.
The big difference between this and App.HTMLHeader is that if you were wrapping this control for resale, you wouldn’t want to need to say to the customer “…and you’ll have to copy this code into App.HTMLHeader for it to work.”
thank you for the explanation. I am able to connect to server and get the callbacks (tested only via alert).
The “last step” for getting it technical running would now be that instead of “alert” I can put the information into a xojo control on my
webpage … maybe I can do it like in the olark examples with a triggerServerEvent in the javascript function.
thank you for the explanation. I am able to connect to server and get the callbacks (tested only via alert).
The “last step” for getting it technical running would now be that instead of “alert” I can put the information into a xojo control on my
webpage … maybe I can do it like in the olark examples with a triggerServerEvent in the javascript function.
thanks, via app.htmlheader the things are working but I don’t get it to run it with WebControlWrapper.LoadLibraries. I tried for example:
WebControlWrapper.LoadLibraries(“onConnect”,“http://glyps.on-rev.com/strophe.js”)
and get:
Could not execute returned javascript: Can’t find variable: Strophe --> “so it is not loaded because this is part of the lib”
ReferenceError: Can’t find variable: onConnect --> “this I see only in the errorconsole of safari”
Is there a example for WebControlWrapper.LoadLibraries available ?