index.html:
Code:
BLAH BLAH BLAH -- HTML gibberish here - no importance (the requests.js and jquery.js are DECLARED in HEAD)
<div id="wrapper">
<div id="home">Welcome! Go to <a onclick="mwl.show('#login');mwl.hide('#home');">LOGIN</a></div>
<div id="login" style="display:none;"><input id="user" /><a onclick="GetResponse(document.getElementById('user').value)">Submit</a></div>
</div>
<div id="msg" style="display:none;"></div>
requests.js
Code:
function GetResponse(user){
$.ajax({
url:'http://blahblah.net/json?user=' + user,
dataType: 'json',
async: true,
crossDomain: false,
success: SuccessLogin,
error: Fail
});
}
function Fail(data){ /*DO nothing awhile. This is not causing any error!*/}
function SuccesLogin(data){
mwl.show('#msg');
mwl.hide('#login');
$('#msg').html(data.message + 'IT WORKS');
}
This code represent what my app code is. And this works perfectly, no errors, but this functions are in the proxy server, and i think this is what causes my app to refresh... and i don't want this.