Connecting Tech Pros Worldwide Forums | Help | Site Map

Not Working Javascript alert in https

Familiar Sight
 
Join Date: Mar 2007
Posts: 172
#1: Nov 10 '08
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.  

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Nov 10 '08

re: Not Working Javascript alert in https


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.
iam_clint's Avatar
Forum Leader
 
Join Date: Jul 2006
Location: Oklahoma
Posts: 1,076
#3: Nov 10 '08

re: Not Working Javascript alert in https


well one thing is you are using return hi() but the hi function isn't returning anything.
Familiar Sight
 
Join Date: Mar 2007
Posts: 172
#4: Nov 15 '08

re: Not Working Javascript alert in https


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?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#5: Nov 15 '08

re: Not Working Javascript alert in https


Try
Expand|Select|Wrap|Line Numbers
  1. <body onload="hi();">
Familiar Sight
 
Join Date: Mar 2007
Posts: 172
#6: Nov 18 '08

re: Not Working Javascript alert in https


Sorry it not working
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#7: Nov 18 '08

re: Not Working Javascript alert in https


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?
Familiar Sight
 
Join Date: Mar 2007
Posts: 172
#8: Nov 21 '08

re: Not Working Javascript alert in https


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?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#9: Nov 21 '08

re: Not Working Javascript alert in https


What do mean by "my system"? Can you describe it? Which browser are you testing on? Have you tried other browsers?
Familiar Sight
 
Join Date: Mar 2007
Posts: 172
#10: Nov 21 '08

re: Not Working Javascript alert in https


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.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#11: Nov 21 '08

re: Not Working Javascript alert in https


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?
Reply


Similar JavaScript / Ajax / DHTML bytes