JavaScript - Help Forgive Me For My Newbness
Similar TutorialsI know it's a cardinal sun, but I have background music on a sub site for my company. I need to be able to turn it on and off. It doesnt seem to work. Can anyone take a second to look at my code and see what might be the issue? Code: <script type="text/javascript"> function stop() { document.getElementById("music").src = ""; } </script> Code: <a href="javascript:stop()" > <img name="_stp_gfx" src="images/_stp_gfx.jpg" width="121" height="55" border="0" id="_stp_gfx" alt="" /> </a> Code: <embed name="music" src="_media/12_8_media.mp3" id="music" autostart="false" loop="false" hidden="true"> Thanks for any help. Any help would be appreciated. I used to be proficient with HTML when everyone used raw code but never really learned javascript. I'm trying to create 3, customized pages for a Cisco WLAN authentication. I took the default "login" page and added a banner and different text (see code below). I don't recall messing with anything else. But I can't see the Submit button, and I'm having problems with the pop-up that's supposed to show "incorrect username/password" if incorrect credentials. Also, I've been told that 3 pages need to be uploaded to the system: login, authentication error, and logout, and I don't really understand what the authentication error page is supposed to contain. Just text saying incorrect login/pass? I wouldn't mind just starting from scratch but I'm unsure of what I need to retain from the original to make sure authentication still works. I welcome and even encourage you to lambaste me for my ignorance Code: <html> <head> <title>AES Corporate Guest Wireless</title> <noscript> <meta HTTP-EQUIV="REFRESH" content="0; url=https://wirelessguestaccess.global.aes.com/login_noscript.html"> </noscript> <script language="javascript" src="./loginscript.js"></script> <script> var url = ""; if(url != ""){ var link = document.location.href; var searchString = "?redirect="; var equalIndex = link.indexOf(searchString); var redirectUrl = ""; if(equalIndex > 0) { equalIndex += searchString.length; redirectUrl += link.substring(equalIndex); //attach the redirect url only if the ext web auth url doesn't contain it searchString = "&redirect="; equalIndex = url.indexOf(searchString); if(equalIndex < 0){ url+= "&redirect="; url+=redirectUrl; } } window.location.href = "/logout.html" ; } function getErrorMsgIfAny(){ if(document.forms[0].err_flag.value == 1){ document.writeln('The User Name and Password combination you have entered is invalid. Please try again.'); }else{ document.writeln(' '); } } function unhideform(){ document.getElementById("formId").style.display = "block"; } </script> </head> <body> <FORM method="post" ACTION="/login.html"> <INPUT TYPE="hidden" NAME="buttonClicked" SIZE="16" MAXLENGTH="15" VALUE="0"> <INPUT TYPE="hidden" NAME="err_flag" SIZE="16" MAXLENGTH="15" VALUE="0"> <INPUT TYPE="hidden" NAME="err_msg" SIZE="32" MAXLENGTH="31" VALUE=""> <INPUT TYPE="hidden" NAME="info_flag" SIZE="16" MAXLENGTH="15" VALUE="0"> <INPUT TYPE="hidden" NAME="info_msg" SIZE="32" MAXLENGTH="31" VALUE=""> <INPUT TYPE="hidden" NAME="redirect_url" SIZE="255" MAXLENGTH="255" VALUE=""> <font face=Calibri, Times New Roman, Tahoma, Helvetica> <center> <table width=805 border=0 cellpadding=5 cellspacing=0> <tr> <td width=805> <img src="aesfront.jpg"> </td> </tr> <tr> <td align=center font color="red"> <font size=4> <b>AES Guest-Wireless Authentication</b> <P> </td></tr><tr><td><font size=3> <script type="text/javascript"> // Popup window code function newPopup(url) { popupWindow = window.open( url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes') } </script> <center> To connect, please enter your guest wireless username and password below. If you do not yet have a username and password, please reach out to your AES contact who can request the creation of the account. </td></tr> <tr><td> <script> getErrorMsgIfAny(); </script> <tr> <td> <table border="0" cellspacing="10" cellpadding="0" align=center> <tr> <td width="100" nowrap>User Name</td> <td> <INPUT type="TEXT" name="username" SIZE="25" MAXLENGTH="80" VALUE=""> </td> </tr> <tr> <td nowrap>Password</td> <td> <INPUT type="Password" name="password" emweb_type=PASSWORD autocomplete="off" EMWEB_TYPE=PASSWORD onKeyPress="submitOnEnter(event);" SIZE="25" MAXLENGTH="127" VALUE=""> </td> </tr> <tr> <td> </td> <td> <script>getHtmlForButton("Submit","Submit","button","submitAction()"); </script> </td> </tr> </table> </td> </tr> </table> </div> </td> <td align="right" > <table border="0" cellspacing="10" cellpadding="0" > <tr> <td align="right" style="padding-top: 25px; padding-right: 20px;" bgcolor="#ffffff" > <div ></div></td> </tr> </table> </td> </tr> </table> </div> </FORM> <P> <center><font size=2>AES Corporation<P> <a href="http://www.aes.com">http://www.aes.com</a> </body></html> |