Hi All,
I've created a test application in sandbox of two simple asp pages.
I've incorporated an swf for the navigation. This swf is having two
buttons which "OnClick" calls a Javascript function. This function,
depending upon the arguments passed, will load the page. The complete
code is given below:
############# XML FILE ###############
<Content type="html" view="canvas">
<![CDATA[
<script type="text/javascript">
function init()
{
var params = {};
params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS ] =
[opensocial.Person.Field.PROFILE_URL];
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest
(opensocial.DataRequest.PersonId.OWNER),'owner'); req.add
(req.newFetchPersonRequest
(opensocial.DataRequest.PersonId.VIEWER,params),'viewer');
req.send(handleViewerData);
};
function makePOSTRequest()
{
app_id = gadgets.util.getUrlParameters()["gadgetId"];
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
var url = "http://xyz.com/orkut/test/home/index.asp?usr_id="+
usr_id.toString() + "&appId=" + app_id.toString();
ctr = "main_content";
gadgets.io.makeRequest(url, callback, params);
};
function callback(resp)
{
document.getElementById('main_content').innerHTML = resp.text;
gadgets.window.adjustHeight();
};
</script>
<script type="text/javascript">
gadgets.util.registerOnLoadHandler(init);
</script>
<script type="text/javascript">
function myfun(str)
{
alert('clicked on ' + str);
url='http://xyz.com/orkut/test/' + str + '/index.asp';
getData(url, 'main_content'); //This function will load the calling
page
}
</script>
<script src="http://xyz.com/orkut/test/test.js"></script>
<div id="main_content" style="width:746px;"></div>
]]>
</Content>
############# XML FILE ###############
############# test.js ###############
function getData(url, container)
{
ctr = container;
var link;
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
var frn_prf = document.getElementById('friendProfile');
if(!frn_prf)
{
var qm = url.indexOf('?');
if(qm >=0)
{
link = url+"&usr_id="+usr_id.toString();
var arrURLTok = url.split('?');
var qn = arrURLTok[1].indexOf('&');
if(qn >=0)
{
var arrParamTok = arrURLTok[1].split("&");
imgID = arrParamTok[0].substr(2);
typID = arrParamTok[1].substr(5,1);
}
}
else
{
link = url+"?usr_id="+usr_id.toString();
}
}
else
{
link = url+"&usr_id="+usr_id+"&usr_name="+escape(usr_name);
}
var link1 = [link, "&appId=",gadgets.util.getUrlParameters()
["gadgetId"]].join('');
gadgets.io.makeRequest(link1,respGET,params);
};
function respGET(obj)
{
document.getElementById(ctr).innerHTML = obj.text;
gadgets.window.adjustHeight();
};
############# test.js ###############
############# Home/index.asp ###############
<BODY>
This is Home Page<BR>
<object width="550" height="400">
<param name="movie"
value="http://xyz.com/orkut/test/button.swf">
<embed src="http://xyz.com/orkut/test/button.swf" width="550"
height="400">
</embed>
</object>
</BODY>
############# Home/index.asp ###############
############# Action Script in button.swf for 'home button'
###############
on (press) {
getURL("javascript:myfun('home');");
}
############# Action Script in button.swf ###############
############# Action Script in button.swf for 'cast button'
###############
on (press) {
getURL("javascript:myfun('cast');");
}
############# Action Script in button.swf ###############
The index page in the Home directory is loading well but when I click
on Cast button, then the Cast page should get loads but nothing gets
happen!! Firefox neither shows any error in the Error Console.
Can any body let me know where I'm going wrong. Before making an API
for this page I've checked that on the server and that was working
fine but when I modified the calling procedure nothing is working.
Please help me as soon as possible.
Thanks & Regards,
Javed
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Orkut Developer Forum" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---