microsoft / Chakra-Samples

Repository for Chakra JavaScript engine related samples.
MIT License
216 stars 84 forks source link

how to use third party js library? #74

Open youshinki opened 7 years ago

obastemur commented 7 years ago

@youshinki A bit more information please.

youshinki commented 7 years ago

@obastemur Thanks for your answer. My project is using a third party js library (http://cdn.ronghub.com/RongIMLib-2.2.5.min.js), and i don't know how to use it with ChakraCore. Can i use document and window object in script?

liminzhu commented 7 years ago

Hey @youshinki . You can load the script to a string, and run JsRunScript to load the library into the current context.

Can i use document and window object in script?

There's no DOM implemented for a pure JS engine, so no not out-of-the-box, though you may use a library such as jsdom if it helps.