Not Working Javascript alert in https

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maheswaran
    New Member
    • Mar 2007
    • 190

    Not Working Javascript alert in https

    Hi I tried simple javascript + form in https. But javascrip alert is not working in some https. Can any one know that why it is not working

    My sample code is

    [code=html]
    <html>
    <head>
    <script>
    function hi()
    {
    alert("gu");
    }
    </script>
    </head>
    <body onload="return hi();return false;">
    <form name="Import" method="POST" onsubmit="retur n hi()" enctype="multip art/form-data">
    <input type="submit" name="submit1" value="submit">
    </form>
    </body>
    </html>

    [/code]
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    When are you expecting it to alert? Why do you have a return false in onload after a previous return? onload doesn't require a return statement anyway.

    Comment

    • iam_clint
      Recognized Expert Top Contributor
      • Jul 2006
      • 1207

      #3
      well one thing is you are using return hi() but the hi function isn't returning anything.

      Comment

      • maheswaran
        New Member
        • Mar 2007
        • 190

        #4
        hi,

        Am not need any return value. Just i want to get the alert. Why this is need is am have one project , on that project alert is working in http:// and not work in https://
        . So am just trying with this simple example and i could not succeed , can tell me why this?

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Try
          Code:
          <body onload="hi();">

          Comment

          • maheswaran
            New Member
            • Mar 2007
            • 190

            #6
            Sorry it not working

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              OK, add a button and try this:
              Code:
              <input type="button" name="btn" value="Click to test" onclick="hi();">
              Does this not work at all or only fails sometimes?

              Comment

              • maheswaran
                New Member
                • Mar 2007
                • 190

                #8
                It falls all time, but i find one thing if am trying with mysystem (which i installed this project) its not work but am trying with network its working...do not why this?

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  What do mean by "my system"? Can you describe it? Which browser are you testing on? Have you tried other browsers?

                  Comment

                  • maheswaran
                    New Member
                    • Mar 2007
                    • 190

                    #10
                    My system is where the application is installed.

                    My system is connected with network. Am using Xamp and installing ssl. while access with localhost it not work. but tried with network (accessing by another computer) its work.

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      That means there's nothing wrong with the code, but something with your settings. You didn't answer the question about browsers. Have you tried other browsers?

                      Comment

                      Working...