Internet Explorer Javascript Object Required Error
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 Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Javascript object required error in IE up vote 1 down vote favorite i'm creating mulitple planet objects in javascript to handle animation. The animation works fine for each planet but i am getting errors in IE 6/7 saying "object required on line 15 char 2" Code: var earthObj = null; var mercObj = null; var jupiObj = null; var animate; function init() { mercObj = document.getElementById('mercury'); earthObj = document.getElementById('earth'); jupiObj = document.getElementById('jupiter'); mercObj.style.position= 'relative'; mercObj.style.left = '54px'; mercObj.style.visibility = 'hidden'; earthObj.style.position= 'relative'; //error on this line earthObj.style.left = '80px'; earthObj.style.top = 300px'; } javascript object animation share|improve this question edited May 13 '12 at 23:50 VisioN 87.1k15146170 asked May 13 '12 at 23:48 user1281921 8629 3 Maybe you missing earth? –VisioN May 13 '12 at 23:50 Show us the markup, and where the script tag is. –Matt Ball May 13 '12 at 23:51 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote Before trying to call an object, test if it exists. earthObj = document.getElementById('earth'); if(!earthObj) { alert("Could not find Earth"); return; } share|improve this answer answered May 14 '12 at 0:08 Niet the Dark Absol 208k36240372 add a
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 Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like http://stackoverflow.com/questions/10576121/javascript-object-required-error-in-ie you, helping each other. Join them; it only takes a minute: Sign up JS Error in IE 8… “Object Required” up vote 0 down vote favorite 1 I am implementing pagination on a project currently in progress but I am getting an error with this piece of code in IE8: var rows = document.getElementById(tableName).rows; Here is the http://stackoverflow.com/questions/6385590/js-error-in-ie-8-object-required error: Message: Object required I am using this open source code for the pagination: http://en.newinstance.it/2006/09/27/client-side-html-table-pagination-with-javascript/ Now my question would be, is this a valid piece of code for ie 8? if not what could I substitute to obtain the same results of the given piece of code? (or how can i fix this error :P) If more information is needed, I'll try my best to provide. javascript internet-explorer-8 share|improve this question asked Jun 17 '11 at 12:15 Dennis Martinez 2,46472947 Is your data coming from the database is in a small nos only ? –Nirmal Jun 17 '11 at 12:23 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted It looks like document.getElementById(tableName) is not finding the table which you're expecting, and so it returns null. null.rows is not valid, and so there's an error there. I'd recommend splitting that line into two and checking that the element is found before continuing: var table = document.getElementById(tableName), rows; if (table) { row
be down. Please try the request again. Your cache administrator is webmaster. Generated Wed, 19 Oct 2016 04:29:19 GMT by s_wx1157 (squid/3.5.20)
Sign in Pricing Blog Support Search GitHub This repository Watch 33 Star 181 Fork 74 zikula/core Code Issues 169 Pull requests 2 Projects 1 Wiki Pulse Graphs New issue in IE8, clicking on a submit button, gives js error 'Object required' #415 Closed tfotis opened this Issue May 25, 2012 · 2 comments Projects None yet Labels Bug Milestone 1.3.4 Assignees jusuff 2 participants Zikula Project member tfotis commented May 25, 2012 to replicate go to Settings module (index.php?module=settings&type=admin&func=modifyconfig) and press save. you will see the error in the bottom-left corner of the browser. the full error is: Message: Object required Line: 363 Char: 17 Code: 0 URI: http://example.com/javascript/helpers/Zikula.js jusuff was assigned Jun 23, 2012 Zikula Project member jusuff commented Jun 24, 2012 @tfotis does this error occur each time you click save or only in sometimes? Asking, because I cannot reproduce it. Zikula Project member tfotis commented Jun 25, 2012 yes it happens every time i click 'Save'. maybe it doesn't occur with every version of IE8. mine is 8.0.6001.18702. Windows XP SP3 i tried to track down the issue... the error is in function Zikula.fixbuttons in file javascript/helpers/Zikula.js it looks like b.attributes.getNamedItem('value') is null jusuff added a commit that closed this issue Jul 4, 2012 jusuff #415 … Buttons without value attr caused error when accessing its val