scriptingBlog.com - For those who work online
Do you have something interesting to share with others? If you do, click here to write a post or a press-release to the blog. All 100% free!

Archive for the ‘jQuery’ Category

Object Expected Error in IE6, IE7 and IE8

Saturday, May 16th, 2009

Now that was weird, at least for me.

I was getting “Object Expected” Error on all Internet Explorer versions, on a perfectly good jQuery script. At first I thought that is an extra comma (,)  something like that:

$(‘#dialog).dialog({
autoOpen: false,
width: 400,
height: 300,
closeOnEscape: true,
position: ['right','top'],
modal: true,
overlay: {
backgroundColor: ‘#fff’,
opacity: 0.8
},
});

But no, the code was ok and the error was for the firs line, firs character ( $(‘#dialog).dialog({ ).

After a few searches on google where i have found nothing to help me I’ve remembered that I had some problems some time ago with the script inclusion:

<script language=”javascript” type=”text/javascript” src=”jquery.js”></script>

Yes, it is a valid w3c markup, but the [type="text/javascript"] piece was the problem, so now I’m including the script like that:

<script language=”javascript” src=”jquery.js”></script>

It’s not a valid v3c markup but at least i did not get that error anymore, and i do not care very much about that because this script is for an online application not for a site.

I cannot explain this error, but if you have any idea about this problem you can share it leaving a comment to this post.

Sorry for my poor English :)