First, Thanks very much for your reply.

Sorry for not being more precise.

The Index.html or any other web page on the site would have the statement:

<body onload="javascript:new Ajax.Updater('fbplugin','fbsidebar.html',{
method: 'PUT', evalScripts: 'false'});">

There is a div in the body of Index.html that is the target:

<div id="fbplugin" class="facebookarea_in">

The file fbsidebar.html is a standard Facebook plugin as follows.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:fb="http://www.facebook.com/2008/fbml";>
<head>
    <body>
    <div id="fb-root">
        <fb:like-box profile_id="xxxxxxxx" connections="10" header="false"
style="background-color:white; border:none; overflow:hidden; width:300px;
height:575px;" allowTransparency="true"></fb:like-box>
        <!--Facebook Javascript SDK-->
        <script>
        window.fbAsyncInit = function() {
            FB.init({appId: 'xxxxxxxxxx', status: true, cookie: true,
            xfbml: true});
        };
        (function() {
            var e = document.createElement('script');
            e.type = 'text/javascript';
            e.src = document.location.protocol +
            '//connect.facebook.net/en_US/all.js';
            e.async = true;
            document.getElementById('fb-root').appendChild(e);
            }());
        </script>
    </div>
</body>
</html>

If I run fbsidebar.html by itself it works just fine on a network connection
that is not firewalled from Facebook. However, my problem is getting passed
the firewall for enterprise users blocked by the firewall.

I need fbsidebar.html to run on the server, and return only the rendered
code. In this (current) configuration, the Ajax.updater in Index.html will
return a bunch of iframes and javascript that make subsequent calls in the
browser to Facebook domains encountering corporate firewalls.

I need to force the response from fbsidebar.html to run on the server. I was
thinking a way to do this is nest Ajax.updater calls.

In a nested version. Index.html would still have this call:

<body onload="javascript:new Ajax.Updater('fbplugin','fbsidebar.html',{
method: 'PUT', evalScripts: 'false'});">

Now fbsidebar.html would look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:fb="http://www.facebook.com/2008/fbml";>
<head>
    <script type="text/javascript" src="js/prototype.js"></script>
</head>
    <body onload="javascript:new
Ajax.Updater('fbloader','fbsidebarcall.html',{ method: 'PUT', evalScripts:
'true'});">
    <div id="fbloader">
    </div>
</body>
</html>

Making a subsequent call to fbsidebarcall.html which is the facebook plugin
call:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:fb="http://www.facebook.com/2008/fbml";>
<head>
    <body>
    <div id="fb-root">
        <fb:like-box profile_id="xxxxxxxx" connections="10" header="false"
style="background-color:white; border:none; overflow:hidden; width:300px;
height:575px;" allowTransparency="true"></fb:like-box>
        <!--Facebook Javascript SDK-->
        <script>
        window.fbAsyncInit = function() {
            FB.init({appId: 'xxxxxxxxxx', status: true, cookie: true,
            xfbml: true});
        };
        (function() {
            var e = document.createElement('script');
            e.type = 'text/javascript';
            e.src = document.location.protocol +
            '//connect.facebook.net/en_US/all.js';
            e.async = true;
            document.getElementById('fb-root').appendChild(e);
            }());
        </script>
    </div>
</body>
</html>

I was hoping this sequence would force fbsidebar.html to run the response
from fbsidebarcall.html to run on the server. However, this version returns
back an empty div to Index.html from fbsidebarcall.html as if the nested
Ajax.Updater call was never executed.

Either nesting Ajax.updater calls doesn't work, or I am doing something
wrong.

On 9/13/10 2:54 AM, "ColinFine" <colin.f...@pace.com> wrote:

> 
> 
> On Sep 10, 7:29 pm, Ed <edfull...@gmail.com> wrote:
>> I have the Facebook Social Plugin (Like Box) in a site that I am
>> building.
>> 
>> A good portion of the visitors are behind corporate firewalls, and if
>> their browsers detect a Facebook domain they will reject the call to
>> the plugin.
>> 
>> I am using the Ajax prototype to make the calls to Facebook from my
>> server which has no firewall that would prevent the Facebook call.
>> However, when you call the Facebook plugins (irrespective of FBML/JS
>> or iFrame version) it returns a bunch of new Javascripts and IFrames
>> that make additional Facebook domain calls defeating the purpose.
>> 
>> I built a version which nests two Ajax Calls with the hope that the I
>> can force all the response to be executed on the Server, and just
>> return the final rendered plugin to the browser. However, the first
>> Ajax.Updater call simply returns what is in the HTML file not allowing
>> it to execute. I don't know if Ajax.updater has the smarts to allow
>> this to work, but I do have the evalscripts option set to true.
>> 
>> What I have in mind is the following process:
>> 1) Call the Ajax.Updater from the Index.html to a file named
>> Loader.HTML
> 
> I don't understand "to a file named" - do you mean that loader.html is
> what is fetched by the Ajax call?
> 
>> 2) When the body onloads it will call another Ajax.Updater that makes
>> a call to Facebook.HTML, which has the FBML to call the Facebook
>> Plugin call.
> 
> When what body (on)loads, where? Ajax.Updater (and any other Ajax
> operation, usually) does not load a page, so no 'onload' event is
> triggered.
> 
>> 3) The response from Facebook.HTML will load into Loader.HTML, which
>> will execute all the iFrames and Javascript that is returning from
>> Facebook
> 
> Where is this Loader.html running?


-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to