website auto logon in browser
Hi,
I am using the below javascript code to open browser and login to web site automatically. But it is browser dependent, only IE can execute this code.
Kindly suggest solutions to implement jquery scripts that is compatible for all browsers.
- <script type="text/javascript">
function login() {
window.onerror=null;
var PAGE_LOADED = 4;
var objIE = new ActiveXObject("InternetExplorer.Application");
objIE.Navigate("http://domain.com/default.aspx");
objIE.Visible = true;
Do Until objIE.ReadyState = PAGE_LOADED : WScript.Sleep(100) : Loop;
objIE.Document.all.loginControl_UserName.Value = "username";
objIE.Document.all.loginControl_Password.Value = "password";
if(Err.Number != 0){
alert("Error: " + err.Description);
}
objIE.Document.all.loginControl_logonButton.Click;
objIE = null;
}
</script>