Hi,
I am trying to write a very simple extension that will output the current windowid onto a webpage. I have the following code:
My problem is that it outputs "undefined" rather than the windowid. I also log the ID to the console and this displays the correct ID.Code:<script> var id; chrome.windows.getCurrent(function(currentWindow) { id = currentWindow.id; console.log(id); }); document.write(id); </script>
I new to javascript so I guess that is where the problem is coming from.
Any assistance would be great.
Thanks.


LinkBack URL
About LinkBacks



Reply With Quote
