Advanced Search

Results 1 to 9 of 9

Thread: Chrome.js Object Required error

  1. #1
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Chrome.js Object Required error

    1) Script Title: chomemenu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...rome/index.htm

    3) Describe problem:
    I'm getting the following error.
    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 3.0; .NET CLR 1.1.4322)
    Timestamp: Mon, 9 Feb 2009 15:29:25 UTC


    Message: Object required
    Line: 165
    Char: 2
    Code: 0
    URI: http://www.myrtlebeachphotography.org/scripts/chrome.js

    My website is http://www.myrtlebeachphotography.org. The error is on every page, because they all use the chrome menu. I've tried deleting any recent changes and I can't see anything in my code that should be causing this. I've also updated to the latest version of chrome.js. I'm really at a loss. Any help would be appreciated. Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,705
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    You've probably mixed up the installation, resulting in a phantom menu or other object. However, the menu appears to work, so getting rid of the error might be all that is required. Around line 165 in the script we find:

    Code:
    addEvent:function(target, functionref, tasktype){
    	if (target.addEventListener)
    		target.addEventListener(tasktype, functionref, false);
    	else if (target.attachEvent)
    		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
    },
    If we change that to:

    Code:
    addEvent:function(target, functionref, tasktype){
    	if (target && target.addEventListener)
    		target.addEventListener(tasktype, functionref, false);
    	else if (target && target.attachEvent)
    		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
    },
    It should eliminate the error on any non-object calls to that function.

    Edit: This actually should work, because I found the problem:

    Code:
    <a href="guestbook/index.htm" rel="shadowbox:height=600;width=700" title="Client Feedback">Testimonials</a>
    There is no drop down for that rel. I know, it is used for something else, but the menu script doesn't know that.

    In any case, as I say, testing for target in the function as I've outlined should take care of the problem. It may give rise to other errors, probably not with the menu script though.
    Last edited by jscheuer1; 02-09-2009 at 03:03 PM. Reason: add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks so much, that seemed to work. I don't notice any other problems that were caused by the change. Thanks again.

  4. #4
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I now noticed that if I hover over the menu item that you quoted that is causing the problem, I get the following error. Would it be better if I just removed the rel for the shadowbox. I'm sure I can do it another way.


    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 3.0; .NET CLR 1.1.4322)
    Timestamp: Mon, 9 Feb 2009 16:21:12 UTC


    Message: Object required
    Line: 52
    Char: 3
    Code: 0
    URI: http://www.myrtlebeachphotography.org/scripts/chrome.js


    Message: Object required
    Line: 154
    Char: 2
    Code: 0
    URI: http://www.myrtlebeachphotography.org/scripts/chrome.js


    Message: Object required
    Line: 52
    Char: 3
    Code: 0
    URI: http://www.myrtlebeachphotography.org/scripts/chrome.js

  5. #5
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry to keep replying to myself. I figured out a solution, I understand what was causing the problem now. I was able to use my same link with the shadowbox, but I had to put it under a new dropmenu4 div. I would rather not have to have a drop down menu for one item, so if there is another solution that would be great. But it works without error for now. Thanks again.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,705
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    You can make up a proxy. Put this link anywhere in the body of the page where it would be a valid link - except in the menu and it's drop downs, it will not be seen or affect the layout:

    Code:
    <a id="proxy" style="display:none;" href="guestbook/index.htm" rel="shadowbox:height=600;width=700" title="Client Feedback"></a>
    Get rid of this:

    Code:
    <div id="dropmenu4" class="dropmenudiv" style="width: 140px;">
    <a href="guestbook/index.htm" rel="shadowbox:height=600;width=700" title="Client Feedback">Client Feedback</a>
    </div>
    Change this:

    Code:
    <a href="#" rel="dropmenu4">Testimonials</a>
    to:

    Code:
    <a href="guestbook/index.htm" onclick="Shadowbox.open(document.getElementById('proxy'));return false;" title="Client Feedback">Testimonials</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Feb 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Wow thanks, I had no idea you could do that. I probably could have saved myself countless hours on my site if I had posted to this forum a long time ago. I think this is unrelated, because the shadowbox never worked in IE 8 anyway, but I'm getting this error unless I use compatibility mode. Would you have any idea how to get the shadowbox script to work in IE8? Also, I've tried the tag to force ie7 compatibility mode <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />, but it never seemed to work for me. Thanks again.


    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 3.0; .NET CLR 1.1.4322)
    Timestamp: Mon, 9 Feb 2009 21:18:40 UTC


    Message: Invalid argument.
    Line: 1
    Char: 1039
    Code: 0
    URI: http://www.myrtlebeachphotography.or...adowbox-2.0.js

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,705
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    I've been resisting installing IE 8 because I still want to maintain a reliable environment for testing in IE 6 and 7. As far as I know, there is no easy way to do so on a single machine. There are a few ways to sort of do it, but that's not good enough for me. As I type I am getting an older machine ready to be the testing environment for IE 6 and 7. Once that is working, I will install IE 8 on the newer machine.

    However, I can tell you that from what I've seen reported about IE 8, there is no guarantee that even the same version of IE 8 running on various machines will work the same*, let alone the various versions of IE 8 that are out there. Unless a more standard version emerges before I'm finished establishing an environment for it, I will be running Release Candidate 1 of IE 8.

    All of this is in part to remind you that there is still no official release version of IE 8, and so - though tempting - there isn't a whole lot of point in testing for it - yet.

    Does Shadowbox have a support site? If so, do they have anything on IE 8 support there? Is there possibly a more recent version of Shadowbox available?


    * To wit, I am currently involved in another thread where the user swears a certain script will not run in IE 8 RC1, not even the demo page on Dynamic Drive, while ddadmin reports, using the same version of IE 8 that it does work.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,705
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    Well, this is strange, though I'm not entirely surprised. I had a heck of a time installing IE 8, ended up putting it on the older machine as it just wouldn't install on the newer machine (I have a few options left to try for that, next on the list is the 'clean boot' method, but I digress).

    Anyways, the shadowbox works fine, no error - at least the one from the link we just made. Oh and the chat one works too.

    I'm thinking it may be some setting in your IE 8, OS, or third party add on. If that's the case, there may be a workaround that would allow it (shadowbox) to run in a slightly limited way for IE 8 even with the settings you currently have.

    And remember, IE 8 is still not official.

    [edit]There's more. If I use the IE 8 developer tools and force your page into IE 8 standards, I get the same error. But even with the browser in IE 8 standards mode, if I let the page itself follow its default setting (I assume from the meta tag), there is no error.[\edit]
    Last edited by jscheuer1; 02-10-2009 at 03:16 PM. Reason: add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •