Skip to main content

jmaki.subscribe function in glue.js not firing in FireFox 2.0

2 replies [Last post]
fakhreldeen
Offline
Joined: 2008-04-13
Points: 0

Hello,

i use a yahoo button for the login form on my J2EE application. To make the button work, i create a custom jmaki.subscribe function. Everything works just fine in IE 7, the function fires, and the user is logged in or displayed error if the username or password are in correct, however, in Firefox, it seems that the function is not firing at all, i tried replacing the code with just a simple alert("test"); and that didn't even work. here is my code:

in glue.js

jmaki.subscribe("/doLogin", function(args) {
jmaki.log("glue.js : onClick request from: " + args.widgetId);

//check to make sure the user entered a username and password
var UserName = document.getElementById("UserName").value;
var Password = document.getElementById("Password").value;
alert("test"); <----- this here doesn't even fire, and there are no errors displayed in the status bar ------>
if (UserName == "")
{
//display error message
document.getElementById("errorUsername").innerHTML = "Please Enter Username";

}
else
{
//hide user name error message
document.getElementById("errorUsername").innerHTML = "";
}
if (Password == "")
{
document.getElementById("errorPassword").innerHTML = "Please Enter Password";
return;
}
else
{
document.getElementById("errorPassword").innerHTML = "";

}
if (!UserName == "" && !Password == "")
{
//perform login
jmaki.doAjax({method : "POST", url : "LoginServlet?UserName="+UserName+"&Password="+Password+"",

callback: function (req) {
//alert('came back');
var tmp = req.responseText;
//alert(tmp);
var message = req.responseXML.getElementsByTagName("message")[0];
if (message.childNodes[0].nodeValue == "Valid")
{
window.location.href="recep/RecepLoggedIn.jsp";
}
else
{
document.getElementById("errorBoth").innerHTML = "Incorrect Username or Password";
}

}
})
}
});

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
carlavmott
Offline
Joined: 2005-02-10
Points: 0

Hi Fakhreldeen,

I just copied the tag and the JavaScript code for the subscriber function and dropped it in my app. I commented out all but the alert and the log message in the glue code and it works fine. Are you still having this problem. I'm running FF 2.0.0.11

Carla

fakhreldeen
Offline
Joined: 2008-04-13
Points: 0

Hi Carla,

yes, I am still having the same problem. I'm using Firefox/2.0.0.14. Can this be the reason? The weird thing is that it works fine in I.E. I always assumed it would be the other way around

thanks Carla,
Sam