Here are some code snippets
In XUL file:
<dialog id="MyDialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="accept, cancel" orient="vertical" ondialogaccept="SendInfo()"
title="Dialog">
<script type="application/x-javascript"
src="chrome://myapp/content/script.js" />
In script.js:
var globalHttpRequest;
function SendInfo(url) {
globalHttpRequest = new XMLHttpRequest();
globalHttpRequest.onreadystatechange = function(aEvt) {
if (globalHttpRequest.readyState == 4) {
if(globalHttpRequest.status == 200) Error_Log("Loaded");
else Error_Log("Error loading page");
}
};
globalHttpRequest.open("GET", url, true); //true means async
globalHttpRequest.send(null);
}
What happens is that I get a javascript error that globalHttpRequest is
not defined on the line where I compare it to 4.
In XUL file:
In script.js:
var globalHttpRequest;
}
_______________________________________________
dev-extensions mailing list
dev-ext...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-extensions
There are other global variables that are also being unset when the
dialog closes. Anyone know why?