Jscript Runtime Error Document Is Undefined
Contents |
to javascript error code 800a1391 jQuery Forum View Course 464 points Submitted by CJDAM over 3 years ago Why do I get an error saying:
Microsoft Jscript Runtime Error 'window' Is Undefined
'document is undefined' when I run my script? I will run my script (script.js) and an error screen pops up saying: Line:1 Char:1 Error: 'document' is undefined Code: 800A1391 Source: Microsoft JScript runtime error 0 votes permalink Had you add jquery file? Add this in your code 6 points Submitted by Lovely Kaushik over 3 years ago
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss
How To Open .js Files
the workings and policies of this site About Us Learn more filezilla about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack notepad++ Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping https://www.codecademy.com/en/forum_questions/51674b962e5434339b0012c2 each other. Join them; it only takes a minute: Sign up javascript error: Microsoft JScript runtime error: 'document.getElementById(…)' is null or not an object up vote 3 down vote favorite I am getting this error when I call a javascript function to display a modal window: Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object The http://stackoverflow.com/questions/7095538/javascript-error-microsoft-jscript-runtime-error-document-getelementbyid code block is: else if (action=="officeview") { document.getElementById("OfficeContent").src="ChangeView.aspx"; ShowFeatureModal('AppView','OfficeContent') The object is this situation, does exist. Error is caused at: document.getElementById line. What else could be causing the error? Update: Index.aspx is calling the javascript function which is located in sysUtilities.js file. The source file is yet a seperate page (ChangeView.aspx) javascript asp.net vb.net share|improve this question edited Aug 17 '11 at 20:48 asked Aug 17 '11 at 15:36 DotNetRookie 1,819104283 1 document.getElementById returns null if the element is not found, and accessing .src of null is not allowed. Where are you using this code? –Digital Plane Aug 17 '11 at 15:39 If you look at the source code of your page (in the browser), can you find a HTML element with id="OfficeContent" ? –M4N Aug 17 '11 at 15:42 @DigitalPlane not sure what you mean by "where am I using this code" It is being used client side, to call a modal window. The user clicks a hyperlink, and this code block is called. –
Need help? Post your question and get tips & solutions from a community of 418,582 IT Pros & Developers. It's quick & easy. Can't Open .js File w/ Script Host https://bytes.com/topic/javascript/answers/828673-cant-open-js-file-w-script-host-error Error P: n/a LayneMitch via WebmasterKB.com Hello. I posted this earlier with the full code http://superuser.com/questions/276614/running-javascript-files-js of the JavaScript file I'm trying to open. I'm posting this again, because the file is not the problem. I seem to be having a 'windows' problem w/ Window Script Host. While this is more of a computer support based problem, I was hoping that someone had any knowledge on how to resolve this situation. The error message is undefined I'm getting is: Line: 5 Char: 1 Error: 'document' is undefined Code: 800A1391 Source: Microsoft JScript Runtime Error Is there any idea on how to resolve this? -- Message posted via http://www.webmasterkb.com Aug 10 '08 #1 Post Reply Share this Question 2 Replies P: n/a Mike Duffy "LayneMitch via WebmasterKB.com"
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Running Javascript files (.js) up vote 0 down vote favorite I've noticed that if you try and run (not edit) a Javascript file, instead of going to edit. It will come up with an error. This error normally sounds like it is missing a reference (your code, not the program running your code). I getting stuff like this: Script: \h0700sdc01\home$\etc. Line: 3 Char: 1 Error: 'document' is undefined' Code: 800A1391 Source: Microsoft JScript runtime error Is this normal? If it doesn't error, then it does nothing. My question is, is it trying to execute it like a program (similar to VBScript)? script javascript share|improve this question asked Apr 28 '11 at 17:41 Xander Lamkins 22121340 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted If the javascript has references to the HTML document object model (DOM), then you will have problems running it like it is a VBScript. This is because the script is designed to perform operations on an HTML document within a web browser. share|improve this answer answered Apr 28 '11 at 17:45 Justin Pearce 2,071716 Are you implying that JavaScript can be run on its own? Can I run it as a separate program? If so, could you provide me with a reference on the subject (more in depth details)? Just points for now :) –Xander Lamkins Apr 28 '11 at 17:59 It would be possible to run javascript on it's own, however you will have to refer to Microsoft's documentation on what all javascript can/cannot do/access in the OS. Most of my familiarity with javascript is within web pages. –Justin Pearce Apr 28 '11 at 18:01 @XanderLamkins JS outside the browser environment is most commonly executed using the Node.js runtime: nodej