logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-28-2011, 10:54 PM   #1
Adam_C
 
Join Date: Feb 2009
Posts: 129
Cool jQuery - set var whilst loading, call on load IE problem

Hi,

When my page is loading it uses the Facebook Javascript API to determine whether or not a user is signed in to Facebook, if they are signed in
Code:
window._signedInToFacebook = true;
... otherwise ...
Code:
window._signedInToFacebook = false;
Then one the page has loaded I want to - for testing purposes - show the value of the _signedInToFacebook in an alert message, however, when I run the jQuery code
Code:
if ($.browser.msie) {
	$(document).ready(function(){
		alert(window._signedInToFacebook);
	});
} else {
	$(window).load(function(){
		alert(window._signedInToFacebook);
	});
}
in Chrome everything works perfectly, but - no surprise - IE just throws an 'undefined' message at me.

Even if I try:
Code:
<body onLoad="alert(window._signedInToFacebook);">
I still get no luck, I've done some routing around but can't find anything like this I guess because its quite specific criteria...

Does anyone know how to correct this?

By the way I'm using newest Chrome release and IE9 beta...

Thanks in advance
__________________
http://adamscarter.co.uk/
Adam_C is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:09 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com