tags:

views:

41

answers:

2
+1  A: 

Your function never executes. Remove the window.fbAsyncInit = function() { } and the code will run as interpreted. Or, use $(document).ready(function() { }); to execute it after the DOM is ready.

Also, the Javascript libraries in the parent frame are not inherited by the child. But you can reference them like parent.fbAsyncInit = function() { } or parent.jQuery(); for example.

Josh Stodola
OK thanks. That async is a Facebook function that they say to use because it will improve performance as anything in it will be called asynchronously.
CoffeeAddict
thanks also for the hint on the IFrame stuff, it was driving me batty...even after trying to research that with .aspx
CoffeeAddict
I guess I don't see though why that JS wouldn't start to at least execute...
CoffeeAddict
@coffee I am not familiar with that function, perhaps you need to explain more in your question about what you are expecting to happen.
Josh Stodola
@coffee As I said, if the parent frame is what references the Facebook JS library, the child frame does not have inherited access to it. So you define the function, but it is never getting called.
Josh Stodola
Ok, just wrapped it in document.ready, still same thing.
CoffeeAddict
All I want to happen is for that alert("got here"); to run..it's not hit as I've stated in my original post and I really don't get why. It's just a facebook function that just initializes a JS SDK.
CoffeeAddict
@coffee Comment out `FB.init` and try again
Josh Stodola
Where is the SDK referenced? This is crucial.
Josh Stodola
updated... and here's the SDK ref: http://developers.facebook.com/docs/authentication/ (Single Sign-on with the JavaScript SDK)
CoffeeAddict
sorry forgot to mention that I double-included the jQuery library into the Sub.aspx for testing...which is a no-no but did not know how to reference the parent's include or did not know if that's how you do that. So probably conflicting if you have loaded 2 of the same file for the jQuery library??
CoffeeAddict
@coffee In my answer I explain how to reference it.
Josh Stodola
yea I know..I'm just "thinking out loud" about it the wrong way...wondering what COULD be causing this problem without applying the parent.jQuery(); yet. I've gone now though and added the parent.jQuery(); already to my Sub.aspx as a line of code in my JS section. I did not ask how, I was thinking about if you did have 2 loaded what would be the result of that if any...anything would blow up possible with including the jQuery library twice. Read my replies carefully ;)
CoffeeAddict
But I'd be getting JS errors if anything was conflicting or the library was missing anyway so it makes no sense still why this is not working..my original problem.
CoffeeAddict
weird, trying to add that jQuery include to my sub. So my include is in the MasterPage.aspx, not the first parent up from the Subt.aspx which would be Main.aspx. so in my MasterPage.aspx I've got <link href="~/content/Styles/Site.css" rel="stylesheet" type="text/css" /> but I don't see how to reference that using .jQuery()
CoffeeAddict
thanks for the help. I still cant' get that include script using jQuery() to work..anyway thanks.
CoffeeAddict
A: 

resolved. That init function should be the only thing in there. Moved all other code outside the window.fbAsyncInit because I do not want to load the others asynchronously, I want to load it after the DOM has completed. The only thing that should be loaded at the same time is the registering/Initialization of that SDK.

CoffeeAddict