Remove 'disabled' of an element which is present in a redirected page
I'm redirecting users from a.html to b.html page after login. There is a
file select button "Select Images" with "disabled" attribute on b.html
page, which I want to be enabled only after FB login. Below is my code for
this.
function fblogin(){
FB.login(function(response) {
if (response.status == 'connected') {
login();
} else {
//window.location.reload();
}
}, {scope:'email,publish_stream'});
return false;
}
function login() {
window.location = "b.html";
document.getElementById('uploadbtn').removeAttribute('disabled');
document.getElementById("genPNG").attr('disabled','enabled');
document.getElementById("genJPG").removeAttribute('disabled');
}
No luck with the above code, so I putted
document.getElementById('uploadbtn').removeAttribute('disabled');
document.getElementById("genPNG").attr('disabled','enabled');
document.getElementById("genJPG").removeAttribute('disabled');
on b.html page. How can I make it work as the way I want? Any help is much
appreciated. Thanks in advance.
No comments:
Post a Comment