By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

Not Working Javascript alert in https

100+
P: 190
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

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script>
  4. function hi()
  5. {
  6. alert("gu");
  7. }
  8. </script>
  9. </head>
  10. <body onload="return hi();return false;">
  11. <form  name="Import" method="POST" onsubmit="return hi()" enctype="multipart/form-data">
  12. <input type="submit" name="submit1" value="submit">
  13. </form>
  14. </body>
  15. </html>
  16.  
  17.  
Nov 10 '08 #1
Share this Question
Share on Google+
10 Replies


acoder
Expert Mod 15k+
P: 16,027
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.
Nov 10 '08 #2

iam_clint
Expert 100+
P: 1,208
well one thing is you are using return hi() but the hi function isn't returning anything.
Nov 10 '08 #3

100+
P: 190
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?
Nov 15 '08 #4

acoder
Expert Mod 15k+
P: 16,027
Try
Expand|Select|Wrap|Line Numbers
  1. <body onload="hi();">
Nov 15 '08 #5

100+
P: 190
Sorry it not working
Nov 18 '08 #6

acoder
Expert Mod 15k+
P: 16,027
OK, add a button and try this:
Expand|Select|Wrap|Line Numbers
  1. <input type="button" name="btn" value="Click to test" onclick="hi();">
Does this not work at all or only fails sometimes?
Nov 18 '08 #7

100+
P: 190
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?
Nov 21 '08 #8

acoder
Expert Mod 15k+
P: 16,027
What do mean by "my system"? Can you describe it? Which browser are you testing on? Have you tried other browsers?
Nov 21 '08 #9

100+
P: 190
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.
Nov 21 '08 #10

acoder
Expert Mod 15k+
P: 16,027
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?
Nov 21 '08 #11

Post your reply

Sign in to post your reply or Sign up for a free account.