Hi, Everyone,
I do a test, a.js call function 'b()' in b.js.
a.js is the main work file,
b.js is the library of functions developed by another develoer.
In Chrome, I can using the following code, the test goes well.
//----------------------------------------------------------
a.js:
new_element=document.createElement("script");
new_element.setAttribute("type", "text/javascript");
new_element.setAttribute("src", "b.js");
document.body.appendChild(new_element);
function a()
{
//...
b();
}
b.js:
function b()
{
//...
}
//----------------------------------------------------------
Now, I need do the test with V8, I can use the following code, but it will be
complicated and not elegant
//----------------------------------------------------------
string scriptFileText = getFileContents("a.js") + getFileContents("b.js");
Handle<String> scriptSource = String::New(scriptFileText.c_str());
Handle<Script> script = Script::Compile(scriptSource);
How can I deal with it, Any of your help will be appreciated!
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.