Assuming you have a global variable in your project called myGlobalVar, and your JavaScript has a defined variable called variableFromWebsite. This would set myGlobalVar to variableFromWebsite, which you can then use in your project as normal.
See editor.construct.net for more examples of how to integrate JS in the event sheet, via local variables. There is also a construct.net/en/forum/construct-3/scripting-51 forum you can ask questions on with people much much more familiar with JS than I am.