Discussion:
wininet with javascript
(too old to reply)
der.moh
2008-08-12 13:06:29 UTC
Permalink
hello,

i am connecting to a web-server and assign two post variables to a
*.php file via the wininet-lib. till this point everything is working,
but the file also contains javascript which does not get executed. i
need the output of the javascript for the further continuation of my
program.


is there a way to get this working, with wininet or some other method?


der.Moh
Dan Mitchell
2008-08-12 19:19:43 UTC
Permalink
Post by der.moh
i am connecting to a web-server and assign two post variables to a
*.php file via the wininet-lib. till this point everything is working,
but the file also contains javascript which does not get executed. i
need the output of the javascript for the further continuation of my
program.
is there a way to get this working, with wininet or some other method?
You need to link in a javascript interpreter (like mozilla's
spidermonkey), pass the javascript to that, and it'll give you the results
of evaluating the script -- you can then start again from there.

-- dan
der.moh
2008-08-14 16:47:57 UTC
Permalink
hello,

i found on wikipedia (german version, i think quoting is senseless),
that spidermonkey does not support the Document Object Model, so i
guess that it is not possible to call functions like
document.getElementById, which i need to fetch content from the html
body...

do you have got an advice?
Dan Mitchell
2008-08-14 20:07:25 UTC
Permalink
Post by der.moh
i found on wikipedia (german version, i think quoting is senseless),
that spidermonkey does not support the Document Object Model, so i
guess that it is not possible to call functions like
document.getElementById, which i need to fetch content from the html
body...
Sorry, I don't know where you'd go there -- I was only using spidermonkey
to evaluate WPAD-style "which proxy server do I use" stuff.

One (difficult) solution would be to declare those external functions
yourself, pass them into the spidermonkey evaluator, and implement
getElementByID yourself; pass the HTML into some sort of HTML-to-DOM
converter somehow? I'm just guessing, I haven't tried this myself.

You could also see if there's an appropriate forum on
forums.mozillazine.org to ask about spidermonkey; searching, there's been
some questions in the past, so it could be worth a try.

-- dan

Continue reading on narkive:
Loading...