views:

128

answers:

1

I'm new in both javascript and V8. According to Google's Embedder's Guide, I saw something in the context section talking about built-in utility javascript functions. And I also found some .js files(e.g. math.js) in the downloaded source code, so I tried to write a simple program to call functions in these files, but I failed.

  1. Does a context created by Persistent<Context> context = Context::New() have any built-in js functions? How can I access them?

  2. Is there a way to first import existing js files as a library(something like src="xxx" type="text/javascript" in HTML page) and then run my own execute script?

  3. Can I call google maps api through the embedded V8 library in app? How?

A: 

3. Google Maps needs a full browser DOM (or at least XMLHttpRequest I guess), you can't use it from just a Javascript library.

Nicolás
Many thanks. I can see the DOM(e.g. XMLHttpRequest)is a browser's built-in object that javascript could use to behave something, so it seems apparently the only way is to import a browser's library?
Victor jiang