Hi All,
I have some tabs and I want to fetch the data(using signed request)
and display it.
Problem:
1. When I click on Tab B, whole XML is fetched again. It shouldnt'
happen. Also I get an error of makeSignedRequest() not defined.

My requirement is : I dont' want put all the JS code, Markup in XML
file. I want to write in modular way like  building a website.

TIA,
-Shiva

Here is the code:

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
        <ModulePrefs title="Test Application" height="300">
                <Require feature="opensocial-0.7" />
        </ModulePrefs>
        <Content type="html">
        <![CDATA[
                <html>
                        <head>
                                <script src="http://www.google.com/
jsapi"></script>
                                <script src="http://example.com/
tabs.js"></script>
                        </head>
                        <body>
                                <div id="output"></div>
                                <script>
 
gadgets.util.registerOnLoadHandler(onLoadHandler);
                                        function onLoadHandler(){
                                                makeSignedRequest
('TABA');
                                        }
                                </script>
                        </body>
                </html>
        ]]>
        </Content>
</Module>

tabs.js
------

var pageMap = {
        'TABA': 'taba.php',
        'TABB' : 'tabb.php',
        'TABC' : 'tabc.php'
};
function output(data){
        document.getElementById('output').innerHTML = data;
}
function makeSignedRequest(pageId) {
        var params = {};
        params[gadgets.io.RequestParameters.AUTHORIZATION] =
gadgets.io.AuthorizationType.SIGNED;
        params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
        var url = "http://example.com/"; + pageMap[pageId];
        gadgets.io.makeRequest(url, response, params);
};
function response(ret) {
        output(ret.data);
};

tab{a,b,c}.php
------------
<?php
?>
<div>
        <span><a href="http://example.com/taba.php";
onclick="makeSignedRequest('TABA');">Tab A</a></span>
        <span>|</span>
        <span><a href="http://example.com/tabb.php";
onclick="makeSignedRequest('TABB');">Tab B</a></span>
        <span>|</span>
        <span><a href="http://example.com/tabc.php";
onclick="makeSignedRequest('TABC');">Tab C</a></span>
</div>
<div>Tab A Contents</div>





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to