0

I am using v8 and i faced next problem - i have an application which running a javascript file ( i simply read it into a string and than execute with

Local<String> source = String::New(javascript); //javascript is string with js file    
Local<Script> script = Script::Compile(source); 
Local<Value> result = script->Run();

how can I send a string variable into this file?

2
  • 2
    Voted to close as this is better asked on Stack Overflow. Commented May 12, 2011 at 15:52
  • 1
    possible duplicate of how to send string data into a javascript? Commented May 12, 2011 at 18:59

1 Answer 1

0

you can try prepending the necessary javascript statements onto your javascript code before you stringify and compile. Another option is to use an accessor which you assign to the context and will tie back to read/write methods in your code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.