[webkit-dev] How to execute a JavaScript containing site with JSCore?

Geoffrey Garen ggaren at apple.com
Thu Jun 11 10:47:08 PDT 2009


Hi Sebastian.

JSEvaluateScript can only evaluate JavaScript; it can't parse HTML.

Cheers,
Geoff

On Jun 10, 2009, at 10:05 PM, Sebastian Linke wrote:

> Hi,
>
> based on my experiences when I ran some javascript code on a webkit  
> context,
> I was trying to do the same with "normal" html code.
>
> It may sound a bit naive, but I simply passed the whole content of a  
> website
> to `JSEvaluateScript()`, using `JSGlobalContextCreate(NULL)` as the  
> context.
>
> This did - as almost expected - not work. The only result I got back  
> was
> `undefined`.
>
> So my question is: How does webkit handle this? In what kind of way  
> is a
> javascript containing website given to the js engine to get back the  
> right
> result after code execution (e.g. today's date displayed on the  
> screen)?
>
> Or do things not go the way I think about and there is no html  
> generated
> return value sent from JSCore? (Hope you know what I mean...)
>
> Regards
>
> Sebastian
>
> PS: My code example: http://paste.pocoo.org/show/122370/
> ___________________________________________________________________
> WEB.DE FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und
> Telefonanschluss für 17,95 Euro/mtl.! http://produkte.web.de/go/02/
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev



More information about the webkit-dev mailing list