ben18285 Posted May 30, 2011 Share Posted May 30, 2011 Hey, I need your help again pleeeaaase.... I have been searching for hours now but I still havent found what I am looking for.... The IE error message is: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C) Timestamp: Mon, 30 May 2011 17:42:38 UTC Message: Object required Line: 3862 Char: 5 Code: 0 URI: http://www.example.com/js/prototype_1.6.0.2.js Here the corresponding code: setOpacity: function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }, Thanks so much in advance, Ben Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/ Share on other sites More sharing options...
seanlim Posted May 30, 2011 Share Posted May 30, 2011 Why would you want to use the style attribute? Since you already have JQuery object, isn't it more convenient to use $(element).css('opacity', ...); Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222479 Share on other sites More sharing options...
seanlim Posted May 30, 2011 Share Posted May 30, 2011 If there is reason for you to use the style attribute, you have to do element = $(element)[0]; Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222481 Share on other sites More sharing options...
ben18285 Posted May 30, 2011 Author Share Posted May 30, 2011 Hey guys, first of all thanks for your quick responses. I have tried it, but both wont work, the error consists.... Any other ideas? Thanks, Ben Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222483 Share on other sites More sharing options...
seanlim Posted May 30, 2011 Share Posted May 30, 2011 Sample page please... Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222492 Share on other sites More sharing options...
ben18285 Posted May 30, 2011 Author Share Posted May 30, 2011 Hi, the affected site is www.grand-tirolia.de Thanks, Ben Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222493 Share on other sites More sharing options...
seanlim Posted May 30, 2011 Share Posted May 30, 2011 Great... so that snippet was from the prototype framework?! There's nothing wrong with it, only the values that you pass to it. $('nrRooms') is returning null because you commented out that element in the HTML source Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222502 Share on other sites More sharing options...
ben18285 Posted May 30, 2011 Author Share Posted May 30, 2011 Umpf.... I should have seen that. Thanks for this! Just one more question: Is there any way I can resolve this without deleting that code from the html source? Thanks so much Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222508 Share on other sites More sharing options...
seanlim Posted May 30, 2011 Share Posted May 30, 2011 So... you uncommented the nrRooms element? or did you delete everything and it somehow works now? And why would you want to delete the code from the HTML source? If you do so, you will have to edit your javascript correspondingly as all the elements that the script references will no longer exist. Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222512 Share on other sites More sharing options...
ben18285 Posted May 30, 2011 Author Share Posted May 30, 2011 I commented it out because it was no required anymore. And as I did not want to delete (because its a friends website) I simply disabled it. How can I do it right so that it is disabled and there are no more errors? I havent taken any actions yet... Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222515 Share on other sites More sharing options...
seanlim Posted May 30, 2011 Share Posted May 30, 2011 If you simply commented out that element, you will have to find references to that element in the page's javascript code, and comment out those lines of code too. But you will have to know what you are doing and understand how that element affects any other elements on the page, or you will probably make a mess out of everything and screwing up the functionality of something else on the page. Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222520 Share on other sites More sharing options...
ben18285 Posted May 30, 2011 Author Share Posted May 30, 2011 Okay, so I´m just gonna leave that part fo a professional lol Thanks very much for your help! Quote Link to comment https://forums.phpfreaks.com/topic/237898-error-object-required/#findComment-1222521 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.