Here I have 2 JavaScript files and I modified the manifest.json as below to avoid errors:
{ "matches": [ "*://example.com" ], "all_frames": true, "css":[ "css/d.css", "css/bootstrap.min.css" ], "js": [ "scripts/jquery.min.js", "scripts/home/msg.js", "scripts/home/modify.js" ] } Now I have an object residing in the msg.js file and I'm only including relevant parts:
o = { "timeStamps" : t.slice(), "messages" : Object.assign({}, a) } console.log(o); help(o.messages, o.timeStamps.length); function help_final(){ return o; } Here console.log(o) is working fine. So i want this object o in another file named modified.js.
Here is my modified.js file:
message_object = help_final(); $.getScript( "msg.js" ) .done(function( script, textStatus ) { console.log( textStatus ); //here i need to access the object o and store it as global variable }) .fail(function( jqxhr, settings, exception ) { }); $(document).ready(function() { console.log("ready!"); //I need to access the obj here console.log(message_object); });