I am getting script error

4 views
Skip to first unread message

Govindji Patel

unread,
Nov 19, 2009, 8:10:33 AM11/19/09
to Google Friend Connect Developer Forum
I got this code from friendconnect and I keep on getting error can
someone help.

<!-- Include the Google Friend Connect javascript library. -->
<script type="text/javascript" src="http://www.google.com/
friendconnect/script/friendconnect.js"></script>
<!-- Define the div tag where the gadget will be inserted. -->
<div id="div-3998944325124655137" style="width:276px;border:1px solid
#cccccc;"></div>
<!-- Render the gadget into a div. -->
<script type="text/javascript">
var skin = {};
skin['BORDER_COLOR'] = '#cccccc';
skin['ENDCAP_BG_COLOR'] = '#e0ecff';
skin['ENDCAP_TEXT_COLOR'] = '#333333';
skin['ENDCAP_LINK_COLOR'] = '#0000cc';
skin['ALTERNATE_BG_COLOR'] = '#ffffff';
skin['CONTENT_BG_COLOR'] = '#ffffff';
skin['CONTENT_LINK_COLOR'] = '#0000cc';
skin['CONTENT_TEXT_COLOR'] = '#333333';
skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';
skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
skin['CONTENT_HEADLINE_COLOR'] = '#333333';
skin['NUMBER_ROWS'] = '4';
google.friendconnect.container.setParentUrl('/' /* location of
rpc_relay.html and canvas.html */);
google.friendconnect.container.renderMembersGadget(
{ id: 'div-3998944325124655137',
site: '13368909452897226801' },
skin);
</script>

This the error

Line: 621
Error: 'fck[...][...][...](...).0' is null or not an object

Bob Aman

unread,
Nov 19, 2009, 12:27:03 PM11/19/09
to google-friend-co...@googlegroups.com
Hi Govindji,

Unfortunately, never having seen that error before, I need more
context to diagnose it. Can you provide the URL where it's happening
so I can take a look?

-Bob

boethius

unread,
Nov 19, 2009, 12:41:38 PM11/19/09
to Google Friend Connect Developer Forum
Close this line, it's bad form to divide it like that.

Bob Aman

unread,
Nov 19, 2009, 12:46:24 PM11/19/09
to google-friend-co...@googlegroups.com
> Close this line, it's bad form to divide it like that.

Extremely likely to have been a line-wrap inserted by email. Not the
issue. He's seeing closure-compiled code in the error, and that means
that the script in question successfully loaded.

-Bob

boethius

unread,
Nov 19, 2009, 2:46:00 PM11/19/09
to Google Friend Connect Developer Forum
But the error could be on other script on the page, so you need to
check the page's code to make that distinction, or is 'fck' a friend
connect specific error?

Bob Aman

unread,
Nov 19, 2009, 3:07:50 PM11/19/09
to google-friend-co...@googlegroups.com
> But the error could be on other script on the page, so you need to
> check the page's code to make that distinction

It's more a matter of just having a complete picture of the
environment that produces this error, since it's not something we've
seen before.

> or is 'fck' a friend
> connect specific error?

It's indicative of an error in compiled code. Right now only a
handful of external scripts use the closure compiler, but all of
Friend Connect does. So there's a good bet that the exception is
raised by something within Friend Connect, however, the root cause may
still be external. For instance, the inclusion of prototype.js breaks
the native JSON parser for some browsers, and to diagnose, I have to
check for those scripts and/or any number of other tell-tale signs of
other issues.

-Bob

Govindji Patel

unread,
Nov 19, 2009, 3:02:50 PM11/19/09
to Google Friend Connect Developer Forum
I do not have anything else on the file to cause the problem
just the code I got from friendconnect its here

http://www.govpatel.com/friend_connect.html

Bob Aman

unread,
Nov 20, 2009, 12:52:29 PM11/20/09
to google-friend-co...@googlegroups.com
> I do not have anything else on the file to cause the problem
> just the code I got from friendconnect its here
>
> http://www.govpatel.com/friend_connect.html

Works fine for me. Something about your browser may be broken. What
browser are you using?

-Bob

Resseguie

unread,
Nov 20, 2009, 1:11:50 PM11/20/09
to Google Friend Connect Developer Forum
FWIW, I see the error described above.

This particular browser is Firefox 3.0.14 on Ubuntu.

In Firebug I see the following:
fck[fcx](b) is null
http://www.google.com/friendconnect/script/friendconnect.js
Line 607

But if I take that same code, remove the extra <center> element and
place it properly within the structure of an HTML document, it works
fine. (Changing the site ID of course.)
http://www.sensorpedia.com/gfc-patel.html

Bob Aman

unread,
Nov 20, 2009, 2:43:09 PM11/20/09
to google-friend-co...@googlegroups.com
> FWIW, I see the error described above.
>
> This particular browser is Firefox 3.0.14 on Ubuntu.

Huh, OK.

> In Firebug I see the following:
> fck[fcx](b) is null
> http://www.google.com/friendconnect/script/friendconnect.js
> Line 607
>
> But if I take that same code, remove the extra <center> element and
> place it properly within the structure of an HTML document, it works
> fine. (Changing the site ID of course.)
> http://www.sensorpedia.com/gfc-patel.html

Yeah, from the look of it, it's probably related to the fact that
there's no HTML document structure in the original page. There might
be some code somewhere in Friend Connect that's trying to locate the
rest of the HTML structure. We could probably make the error less
obtuse, but I think the real solution here is simply to use at least
the basic HTML structure in your page.

-Bob

Bob Aman

unread,
Nov 20, 2009, 2:52:49 PM11/20/09
to google-friend-co...@googlegroups.com
> There might
> be some code somewhere in Friend Connect that's trying to locate the
> rest of the HTML structure.

Ahah! Figured it out. Because the page structure is invalid, Firefox
takes a guess about how to build the DOM of the page, but
unfortunately, it guesses wrong. The script block gets interpreted as
being part of the page header, and thus gets executed before the DOM
is fully available. It tries to search for the gadget div, but since
it doesn't exist yet, it comes back as null, causing the error that is
being seen. Unfortunately, because the error is ultimately a
misinterpretation of the structure of the page by the browser, there's
very little that we can do to make it more obvious what's actually
wrong to the site owner. The solution here is still to fix the HTML
of the page.

-Bob

Govindji Patel

unread,
Nov 20, 2009, 3:46:50 PM11/20/09
to Google Friend Connect Developer Forum
Hello Bob

Thank you for help and I got it working I figured out what I was doing
wrong
by testing it on file, I just added it to the website and and bang
it is working

Govindji Patel
Reply all
Reply to author
Forward
0 new messages