You must Sign In to post a response.
  • Category: HTML

    Onload function does not work

    Hi Friends,
    In Html page onload function does not fire
    <script type="text/javascript">
    function getQuerystring() {
    debugger;
    var q = document.location.toString();
    q = q.split("?");
    if (q.length > 1) {
    q = q[1].split("&");
    var str = ""
    for (i = 0; i < q.length; i++) {
    tmp = q[i].split("=")
    str += i + tmp[0] + tmp[1];
    }
    if (str != '') {
    alert('Lab Reference Number or Password is incorrect. Please verify and enter again.');
    }
    }

    }

    window.onload = function () {
    debugger;
    getQuerystring()
    }
    </script>
  • #761171
    Hi Pratheepa,

    Press F12 on your keyboard and then click on Console and see the error log, may be because of some other issues of javascript it may be failed. Please recheck and let us know.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #761172
    Hello Pratheepa,

    Update your code :
    window.onload = function () {
    init(); // This is optional
    getQuerystring();
    }
    </script>

    Or you can use
    <body onload="getQuerystring();">

    This both works same.

    Hope this will solve your problem.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #761176
    Hi naveensanagasetti ,


    i am getting this error
    Not allowed to load local resource: file:///E:/Pratheepa/LoginPage.html?Error=%20Error

  • #761178
    Hi Nirav Lalan

    i was tried these both method but it is not working

  • #761181
    Hi Pratheepa,

    Here is the solution for the above error, Please check

    https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=Not+allowed+to+load+local+resource

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #761184
    Hi Pratheepa,
    Run the application, Open firbug by pressing F12, when there is error, take print screen on the console tab and attach it so that it will be more easy to find the issue

    Do Good... Enjoy your life.....

  • #761201
    Hi
    Pradeep

    You can follow this steps you can achieve your output

    Step1
    First Page Code


    Response.Redirect("WebForm9.aspx?Empno="+ 100);


    Step2:
    Second Page Code

    Client Side

    <script type="text/javascript">
    function getQuerystring() {
    debugger;
    var q = document.location.toString();
    q = q.split("?");
    if (q.length > 1) {
    q = q[1].split("&");
    var str = ""
    for (i = 0; i < q.length; i++) {
    tmp = q[i].split("=")
    str += i + tmp[0] + tmp[1];
    }
    if (str != '') {
    alert('Lab Reference Number or Password is incorrect. Please verify and enter again.');
    }
    }

    }

    window.onload = function () {
    debugger;
    getQuerystring()
    }
    </script>


    </head>
    <body onload="getQuerystring();">


    I have attached Snapshots given below check them

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

    Delete Attachment

  • #761214
    Hai friends,
    its working fine.Thanks a lot

  • #761216
    Hi Pratheepa,

    You can refer my article in DNS for all the dotnet concepts including the different State Management Methods. Please refer the link below:

    http://www.dotnetspider.com/resources/45992-Technical-interview-question-in-Igate.aspx

  • #761217
    Hi
    Pradeep

    Hi did you fixed for your issue?


    If you my answer is fixed in your issue means select as best answer which is in my response below.

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.


Sign In to post your comments