I am making simple bot which will take values from script then it will put them into the textboxes of another website and then perform click on button so the bot can log in another website I have written the code, but I want to call it when page is fully loaded. I tried <body onload> but it doesn't work.
Is this possible that we could call our javascript function from our c# code file under the documentcompleted event or any other way?
<script type="text/javascript">
function myf() {
document.getElementsByTagName("INPUT")[1].setAttribute("value", "userabc");
document.getElementsByTagName("INPUT")[2].setAttribute("value", "passwordabc");
document.getElementsByTagName("INPUT")[3].click();
}
</script>
//C# Code file
protected void Page_Load(object sender, EventArgs e)
{
Response.Redirect("https://www.iauc.co.jp/auction/prelogin01_en.jsp?timestamp=1360652615774");
}
protected void Page_LoadComplete(object sender, EventArgs e)
{
//Can we call javascript function here
}
jQueryin yourmyffunction. It will improve cross-browser behaviour.