The following code displays ‘Login’ link. When its clicked, the request is passed and the returned text is ‘Hello’. Its confirmed using the Firebug’s Inspect tab.
<a onclick="new Ajax.Request('/user/loginajax',{onComplete:function(request){showResponse},
method:'get', evalScripts:true}); return false;" href="#">Login</a>
function showResponse(req) {
$('dologin')[removed] = req.responseText;
alert('Call successful');
}
The following is the div that should get updated with the returned ‘Hello’ text. But this div’s content doesn’t change. And the alert(‘Call successful’) also doesn’t gets called.
<div id="dologin">nothing</div>
Can you please figure out the missing in the above code?
Thanks.
