Internet Explorer Object Expected Error
Contents |
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 object expected error in javascript while calling a function Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation object expected error in javascript onclick Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like object expected error in jquery you, helping each other. Join them; it only takes a minute: Sign up “Object expected” error using jQuery only in IE8 up vote 5 down vote favorite 1 I'm getting an error only in IE (v8, I
Script5007: Object Expected
don't know if it happens in older IE versions, but it does not occur in Chrome or Firefox) which brings me the following message when I use IE dev tool's debbuger: Breaking on JSScript runtime error - Object Expected Here is my affected code: $('#deviceProfileSelection').change(function() { //affected line!!!! // rest of my code... }); This element #deviceProfileSelection is defined as the following: I've already typeerror object expected tried defining the .change listener into a $(document).ready(function () {}); but no success at all. Any other idea? EDIT I was trying to include a div using a PHP decision structure, where if a condition was true, it should print a div. But, actually it wasn't printing, I mean, it wasn't printing the opening tag 'div', only the closing tag 'div'. The browsers could interpret this error, but IE8, and this IE inability was causing the issue. javascript jquery html internet-explorer internet-explorer-8 share|improve this question edited Aug 17 '15 at 16:36 asked Aug 2 '13 at 15:16 Victor F 3681420 3 do you have jQuery included on the page before attempting to call $? –jbabey Aug 2 '13 at 15:18 1 What version jQuery are you using? –putvande Aug 2 '13 at 15:20 4 please note that jQuery v2.x does not support IE8. If you have jQuery v2, you will need to use v1.x instead. –Spudley Aug 2 '13 at 15:22 Could you show the code that is inside this function? –Adaz Aug 2 '13 at 15:23 add a comment| 5 Answers 5 active oldest votes up vote 3 down vote accepted The problem is that you haven't added jQuery into your code at all. Add the following inside the
tag: That should fix yhere for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and lodash ie8 policies of this site About Us Learn more about Stack Overflow the
Javascript Runtime Error Object Expected
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Expected ' ' Javascript Error
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 http://stackoverflow.com/questions/18020471/object-expected-error-using-jquery-only-in-ie8 a minute: Sign up Object expected error in Internet Explorer up vote 2 down vote favorite The code works as it should in Firefox and Chrome. When the page loads in Internet Explorer, you get the error User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center http://stackoverflow.com/questions/3512817/object-expected-error-in-internet-explorer PC 6.0; eSobiSubscriber 2.0.4.16; FDM; InfoPath.3) Timestamp: Wed, 18 Aug 2010 13:48:54 UTC and when you press a link echo $alp[$l]; ?> you get the error Message: Object expected Line: 4 Char: 1 Code: 0 URI: Message: Object required Line: 24 Char: 4 Code: 0 URI: There are no errors in Firefox or Chrome, just IE. Any help would be appreciated. Here is my code: function toggleLayer( whichLayer ) { var sub=new Array(); for (i=1;i<25;i++) { sub[i] = 'sub'+i; } var elem, vis; if( document.getElementById ) // this is the way the standards work elem = document.getElementById( whichLayer ); else if( document.all ) // this is the way old msie versions work elem = document.all[whichLayer]; else if( document.layers ) // this is the way nn4 works elem = document.layers[whichLayer]; vis = elem.style; // if the style.display value is blank we try to figure it out here for (i=1;i<26;i++) { eelem = document.getElementById( sub[i] ); vvis = eelem.style; if(eelem==elem){ vvis.display = "block"; } else { vvis.display = "none"; } } if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none'; vis.display = (vis.displ
Question Need help? Post your question and get tips & solutions from a community of 418,571 IT Pros https://bytes.com/topic/javascript/answers/728741-how-solve-object-expected-error-ie & Developers. It's quick & easy. how to solve the object expected error in IE P: 1 hatem0 Hi all I don't know if I am in the right forum, I hope that someone can help me. I am not a programer, my problem is when I open a website like facebook or howstuffworks the page don't open correctly or it open object expected but with error on page. I double click on the explamation mark, they said "object expected" in different line but the same char and code. also not only object expected I face, there is also "unterminated string constant" "object doesn't support this property or method" I don't think that the problem is from the page itself because facebook or howstuffworks have object expected error proffesional programers, in additions of that, these pages open correctly on my friend laptop. I am using IE6 - XP sp2. plz does someone have the solution or have an idea about the problem??? Oct 26 '07 #1 Post Reply Share this Question 4 Replies P: 77 helimeef Well, my first tip is to get rid of Internet Explorer and switch to Firefox. It will be much faster and nicer, and it supports what we call "standards", that every browser besides IE follows for our coding to be consistent for every browser. Now, for the errors. These are all JavaScript errors, and although they are professional programmers, they are inevitable. Google has 50 errors, Digg has 70 errors, etc. Microsoft decided to be stupid and throw the errors in users' faces... Just ignore them and use Firefox, because frankly, Internet Explorer Sucks. Oct 26 '07 #2 reply Expert Mod 5K+ P: 5,133 gits changed thread title ... don't use plzzz... etc. there ... read the posting guidelines and use a good thread title please ... kind regards Oct 26 '07 #3 reply 1