Question : firefox extensions development- getting undefined

Ok.. I'm a little stomped on this.. I need to get the retruned match on this bit of code for a firefox extention... I can alert the fist time.. //alert(m[1]); but I only undefined from

            var versionIS=GetCMSMSpassive();
            alert(versionIS);

Not sure what is going on.. help please :D .. thank you.. Cheers -Jeremy



1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
function GetCMSMSpassive() {

  var jQ = jQuery.noConflict();
	jQ.ajaxSetup({async: false});
  var verionDoc='http://'+window.top.getBrowser().selectedBrowser.contentWindow.location.host+'/doc/CHANGELOG.txt';
  jQ.get(verionDoc, function(data) {
	  var re = new RegExp(/(?:Version)\s+(.*?)\-(.*?)/);
	  var m = re.exec(data);
	  if (m == null) {
		return false;
	  } else {
		alert(m[1]);
		return m[1];
	  }
	});
}

FBL.ns(function() { with (FBL) { 
Firebug.CMSMSForFirebug = extend(Firebug.Module, 
{ 
    shutdown: function()
    {
      if(Firebug.getPref('defaultPanelName')=='CMSMSForFirebug') {
        Firebug.setPref('defaultPanelName','console');
      }
    },
    showPanel: function(browser, panel) 
    { 
		var versionIS=GetCMSMSpassive();
		alert(versionIS);



and so forth from there..

Answer : firefox extensions development- getting undefined

OK, got it. Find the  code below.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
function GetCMSMSpassive() {
  ret_status=false;
  var jQ = jQuery.noConflict();
	jQ.ajaxSetup({async: false});
  var verionDoc='http://'+window.top.getBrowser().selectedBrowser.contentWindow.location.host+'/doc/CHANGELOG.txt';
  jQ.get(verionDoc, function(data) {
	  var re = new RegExp(/(?:Version)\s+(.*?)\-(.*?)/);
	  var m = re.exec(data);
	  if (m == null) {
	      ret_status=false;
	  } else {
             ret_status =m[1];
	  }
	});

return status;
}
Random Solutions  
 
programming4us programming4us