IE6.0 fb.start Error

Page: 1

Author Post
lorman
Guest
I am getting the following error when using FloatBox/XAJAX in combination. I am trying to programatically display a hidden div not by clicking a link but by using the fb.start method.

The error I am getting is:

ERROR: ExecuteCommand (#2, "execute Javascript"):TypeError: Object doesn't support this property or method

This is illustrated at:

http://justkidsstore.no-ip.biz/prod/quinny/2008-buzz-stroller/Capri

The php code is:
$objResponse->script("fb.anchors.length = 0;fb.tagAnchors(document.body);fb.start({href: '#cartPopup', rev: 'width:600 height:300', title: 'Your Shopping Cart'});");
Which fires off the javascript on the page submission.

Please help!!!

Thanks
Administrator
Registered: Aug 2008
Posts: 3382
Hi lorman,
Did you fix somthing? The floatboxed images and the shopping cart confirmation are both working fine for me (FF, IE, Chrome). The shopping cart opens up the xajax debug browser window, but there are no errors listed in the activity logs in that window.

I do notice that you have the following inline script in your document body.
<script>
var fb;
fb.start({href: '#accessories', rev: 'width:600 height:300', title: 'Your Shopping Cart'});
</script>

That will throw a harmless error because fb does not exist until the dom has finished building, and the inline code will fire before the dom build is done.

Hold the phone: I just read the title reference to IE6. I'll poke around with that. Be right back...
Administrator
Registered: Aug 2008
Posts: 3382
In both IE6 and IE8, when you click the cart button, a javascript error is thrown. It is reported as "syntax error, line 1 char 6". Which is not helpful at all. Line 1 is the doctype declaration. It is possible that whatever is throwing that syntax error is creating the xajax problem in ie6 but is getting away with it in ie8. The syntax error is not being thrown in Firefox.

The floatbox code you quoted as being passed to the script function looks correct to me. I don't see any problem there. I can't debug xajax for you, and I think the problem is with that.

But let me make this observation. I know xajax is a popular library, but it strikes me as a very odd way to implement floatbox behaviour on a page. Using it creates unnecessary layers of complexity that risk generating difficult problems such as yours, and makes solving those problems very challenging. You've got server side code pushing content into a hidden div, then pushing script onto the page to launch floatbox and fetch that hidden div content. If it were me, I'd ditch the xajax stuff altogether. Instead of the php page pushing the content you want into a div, have it simply return the html you want displayed in floatbox. Then your cart button can be just a standard floatbox-enabled link of type:ajax. A much simpler approach with less opportunity for obscure errors.

Page: 1