Jump to content

Search the Community

Showing results for tags 'document of null'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hello & Thanks, I am getting error msg: jsMsgBoxPlusTinker.html:13 Uncaught TypeError: Cannot read property 'document' of null at myFunction And I can't see my error, need help from someone with better eyes than me, Thanks: <!DOCTYPE html> <html> <title>file:///C:/vmars.us/javascript/SimpleGame-js/ClaustrophobiaGame/jsMsgBoxPlusTinker.html </title> <body onload = "myFunction()"> <p>Click Button to open a msgBox</p> <button onclick="myFunction()">msgBox</button> <script type = "text/javascript" > var myWindowHtml = '<p>Yes , No , Continue , Cancel ?</p><p><button id="yesBtn">Yes</button><button id="noBtn">No</button><button id="continueBtn">Continue</button><button id="cancelBtn">Cancel</button></p>'; var myWindow; var btn1 = "yesBtn"; var btn2 = "noBtn"; var btn3 = "continueBtn"; var btn4 = "cancelBtn"; function myFunction() { myWindow = window.open("", "MsgWindow", "width=400,height=100"); myWindow.document.write(myWindowHtml); myWindow.document.getElementById(btn1).addEventListener("click", function(){yesClick();}); myWindow.document.getElementById(btn2).addEventListener("click", function(){noClick();}); myWindow.document.getElementById(btn3).addEventListener("click", function(){continueClick();}); myWindow.document.getElementById(btn4).addEventListener("click", function(){cancelClick();}); } function yesClick(){ alert("you Clicked Yes !\n Bye..."); myWindow.close(); } function noClick(){ alert("you Clicked no !\n Bye..."); myWindow.close(); } function continueClick(){ alert("you Clicked continue !\n Bye..."); myWindow.close(); } function cancelClick(){ alert("you Clicked cancel !\n Bye..."); myWindow.close(); } </script> </body> </html>
×