Html View retrieve Javascript value

BlitzMax Forums/MaxGUI Module/Html View retrieve Javascript value

Shagwana(Posted 2014) [#1]
Is it possible to obtain a JavaScript value from a Html View (presuming I can run my desired script)?


skidracer(Posted 2014) [#2]
Not easily. Setting the src value of an iframe should generate a GET that you can process.


Shagwana(Posted 2014) [#3]
What is the string returned from HtmlViewRun()? I was hoping it would be the return value of the JavaScript function I called.


Brucey(Posted 2014) [#4]
HtmlView probably needs a lot of work to push pass its genericness and get you access to more lower level stuff.
To do it with WebKit (OS X and Gtk WebKit on Linux) only requires a few lines of code, whilst other platforms will vary considerably. Qt has a nice interface for this kind of stuff.


Derron(Posted 2014) [#5]
As soon as your html-view-thingy is capable of dom-handling you can just read what Jscript changed.

As soon as it is just a simple html-parser (like the php-script tcpdf uses for generating pdfs out of html) this wont work.

As iFrames are still a beast from the 90s which should be dying since ages it is a whacky hacky way to still use it (but if other ways are not working... ).


@returned value
why should it be the result of a jscript function? Does LoadImage() return Image.width?

Maybe there is a complete resultset available somewhere - so one could see what happened "internally", but I really doubt it.


bye
Ron


skidracer(Posted 2014) [#6]
Derron, I don't get your opinion on iFrames, what is so wacky about one site embedding the contents of another site in it's design while keeping the data between the two separate in a secure manner?

Shagwana, I tried pretty hard to implement Run to return current value but unfortunately came to conclusion it was not possible under IE. I consider iframe gets are ok as it is common practice when ajax is not available to use such approach for host / client communications.

For background see the chatter on this page:

http://msdn.microsoft.com/en-us/library/aa741364(v=vs.85).aspx


Derron(Posted 2014) [#7]
There was a time when iframes marked documents "invalid" when checking them for eg. xhtml validity.

Seems people changes their opinions. Maybe browsers handle it secure enough now (what you said: separate data in a secure manner). In the past especially the Internet Explorer was vulnerable. Depending on the source of the "HtmlView" this might be of interest for a developer.

For me using "iframes" was the same as using "eval(remoteScriptDataOfUnknownOrigin);" embedded in your page :D.

If that is no longer a problem, then the "get"-method could be an option.


bye
Ron