× Joomla Facebook Connect support forum

Topic-icon IE javascript error

Active Subscriptions:

None
13 years 5 months ago - 13 years 5 months ago #6008 by playak
IE javascript error was created by playak
I'm getting a javascript error in IE, but only when I start up IE. If I hit reload, everything is fine again.

Error:
Message: 'document.getElementById(...)' is null or not an object

Strange thing is, that the following javascript is inserted before the html even starts. See start of page source:
 <div id="fb-root"></div>
<scrip t etc etc.... 
...
document.getElementById('fb-root').appendChild(e);
...
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

After a page reload, that piece of javascript appears where one would expect it, not before the start of html.

Only occurs when I'm logged in through Joomla. When not logged in or logged in with Facebook, this error doesn't occur. Almost looks like one of the modules: jfbc login or hellome, is causing this...

This is driving me nuts. Tried to look for the exact cause, but I can't find it.

Any help would be highly appreciated.

Cheers,
Jeroen
PS: Using Joomla 1.5.9 with legacy enabled, JFBC 3.0.2
Last edit: 13 years 5 months ago by playak.
The topic has been locked.
Active Subscriptions:

None
13 years 5 months ago #6009 by playak
Replied by playak on topic IE javascript error
one little step further: if I disable the jfbconnectuser plugin, the problem disappears, so it must be that plugin...
The topic has been locked.
Support Specialist
13 years 5 months ago #6014 by alzander
Replied by alzander on topic IE javascript error
Hmmm.. Haven't heard of that issue before. Can you see if you get the same behavior on our demo page (or this page)? We already know of some issues with how we've been inserting the Javascript code, and have a much improved method in 3.1 (coming out in December). This should fix your issues then, but obviously, we'll try to get you fixed up with something before then.

When I go to your page in IE, I'm not seeing the error. I haven't tried it as my homepage yet, if that's what you mean.. if you have more details on how to see it, that would help. I used IE8 on Win7.
The topic has been locked.
Active Subscriptions:

None
13 years 5 months ago #6017 by playak
Replied by playak on topic IE javascript error
Thanks Alzander.

you have to be logged in to reproduce the problem, so I just PM'd you the login details for a test account.

It looks like jfbconnectuser fires way too early. It also happens in Firefox, but the effect is different. In Firefox, the result is a CSS problem: part of the text shows very large. But the cause is the same: jfbconnectuser pumps out that javascript before the html.

Any help would be mcuh appreciated!

Cheers,
Jeroen
The topic has been locked.
Active Subscriptions:

None
13 years 4 months ago #6023 by playak
Replied by playak on topic IE javascript error
any progress on helping me solve this?
The topic has been locked.
Support Specialist
13 years 4 months ago #6026 by alzander
Replied by alzander on topic IE javascript error
Howdy. Sorry for the delay in responding. Too much turkey and family over the holidays. Moving slowly, and this didn't seem super critical (not that we don't want to help). After thinking about it more.. since you have something that auto-logs users in, it's not just if they have your home page bookmarked, so this obviously could be higher priority than we thought originally as anytime they return to your page, this may happen.

What do you have running on your system that's keeping user's logged in? It doesn't seem like the standard Remember Me plugin with Joomla, and I don't think I've seen the functionality like I'm seeing on your site in CB. I agree, we're doing something wrong. We do have a fix that should work for you as well in 3.1. This is a problem that's manifested itself in a few different ways on different sites and configurations. Yours is the strangest, by far, but all root down to the same cause (us injected Javascript directly into the output, which we agree we shouldn't, and won't be doing soon).

However, for the User plugin to be firing so soon, like it is on your site, it makes me think that there's some other system plugin that's calling it very early, and it may be causing part of the conflict (by exposing our issue). If you have any more information on how your site's configured, that may help.

I hate to say 'wait', but the fix we have for 3.1 is pretty extensive and comes with a bunch of other improvements. It's unfortunately not a switch we can just flip to make work on 3.0.x. If we get more info on how you're setup, it may help us come up with a stop-gap solution for you right now (as we've done for the few others with this problem).

Thanks, and sorry again for the delay.

Edit: Added a little more clarity to the non-critical statement above.
The topic has been locked.
Support Specialist
13 years 4 months ago #6088 by alzander
Replied by alzander on topic IE javascript error
Playak,
We have found the problem. It's something that's been around for a little while, but manifests itself in different ways. There's 2 options right now for solving this issue as you're experiencing on your site. The ultimate solution will be in JFBConnect 3.1, which fixes how we insert the Javascript onto the page in general.

To fix:
* Disable the "Remember Me" ability for now. This functionality is part of the problem because before the page loads, the Remember Me plugin fires and then calls the JFBConnect User plugin.. which then causes the problem. After 3.1, you'll be able to re-enable this plugin
* Perform the code change in the post below. This will allow you to keep the Remember Me functionality intact.. but is a code change.
www.sourcecoast.com/forums/topic?id=1366&p=1#p5386

Sorry for the troubles. We're very focused on the final development stages of JFBConnect 3.1 now and will be testing over the next week or so. Mid-month is our optimistic target for getting it out.
The topic has been locked.
Active Subscriptions:

None
13 years 4 months ago #6092 by playak
Replied by playak on topic IE javascript error
brilliant. disabling remember me is not an option for me. the other trick helped. now let's just hope there are no weird side effects :)
The topic has been locked.
Support Specialist
13 years 4 months ago #6096 by alzander
Replied by alzander on topic IE javascript error
Awesome. Glad it worked. There really shouldn't be any problems with this, but I can't guarantee it. The reason we didn't include the update in any of the 3.0.x releases is cause we couldn't be sure of how weird configurations could interact with it. It's unlikely though, but we never thought the Remember Me box would be a problem either...

The solution we have in 3.1 is much better and more immune to 'weirdness'.

Let us know if you do run into problems, and we'll figure out a fix for the fix :)

Thanks!
The topic has been locked.