help,for how to program to google.

On 7 ago, 13:13, "api.sh" <[EMAIL PROTECTED]> wrote:
> Hi Javed,
>
> Since when you call playVideo.asp, you are passing vid as parameter,
> why don't you just use it for postActivity as well?
>
> -S
>
> On Aug 2, 3:37 am, Deepak <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi All,
>
> > Ive' created an XML file for my application. In this XML file, Im
> > calling respective Open Social functions
> > to retrieve Viewer details. After that Im calling
> > "gadgets.io.makeRequest()" to display my site
> > content(ASP page) where the viewer can play any video and add that to
> > his favourite list.
>
> > But Im getting lot of troubles in doing this. At the start, Im not
> > involving in playing the video file and
> > adding to fav list but just tracing the Viewer Id, which Im getting in
> > the XML file, in this ASP page .
>
> > Below is the code:
> > ##########Gadget (XML)############
> >  <![CDATA[
> > <script type="text/javascript">
> > var V_id;
> > var V_name;
> > var test;
>
> > function init()
> > {
> >   loadViewer();
>
> > }
>
> > function loadViewer()
> > {
> > var params = {};
> > params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
> > [opensocial.Person.Field.PROFILE_URL];
>
> > var req = opensocial.newDataRequest();
> > req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER,pa­rams),
> > 'viewer');
> > req.send(fetchPersonHandler);
>
> > };
>
> > function fetchPersonHandler(resp)
> > {
> > if (!resp.hadError())
> > {
> >         var viewer = resp.get('viewer').getData();
>
> >         if(viewer && viewer.isOwner())
> >         {
> >                 alert("Viewer is same as owner in XML file");
> >                 V_id = viewer.getField(opensocial.Person.Field.ID);
> >                 V_name = viewer.getDisplayName();
> >                 test = 2;
> >                 alert('Id in fetchPersonHandler in XML file ' + V_id);
> >                 alert('Name in fetchPersonHandler in XML file ' + V_name);
> >                 alert('test in fetchPersonHandler in XML file ' + test);
>
> >                 makeServerRequest();
> >         }
> >         else
> >         {
> >                 alert("Viewer is not same as owner in XML file");
> >         }}
>
> > else
> > {
> >         alert('error in fetchPersonHandler in XML file');
>
> > }
> > };
>
> > function makeServerRequest()
> > {
> > var params = {};
> > params[gadgets.io.RequestParameters.CONTENT_TYPE] =
> > gadgets.io.ContentType.TEXT;
>
> > usr_id = "?u_id=" + V_id.toString();
> > usr_nm = "&u_name=" + V_name.toString();
> > tst = "&t=" + test.toString();
>
> > var url = ["pathTotheServer/playvideo.asp", usr_id, tst].join('');
> > alert(url + " in XML file");
>
> > gadgets.io.makeRequest(url, response, params);
>
> > };
>
> > function response(obj)
> >  {
> >  document.getElementById('server').innerHTML=obj.text;
> >  gadgets.window.adjustHeight();
> >  }
> > </script>
>
> > <script type="text/javascript">
> >   gadgets.util.registerOnLoadHandler(init);
> > </script>
>
> > <div id="server"></div>
> >   ]]>
> > ##########Gadget (XML)############
>
> > ##########playvideo.asp############
> > <% Option Explicit %>
> > <!-- #include file = "../../adovbs.inc" -->
>
> > <script src="concat.js" type="text/javascript"></script>
>
> > <!-- #include file = "playVideo.file" --> 'This JS file contains the
> > same script as in XML file
> > <%
> > Dim uId, uName, test
> >         If(Request.QueryString("u_id") = "") Then
> >                 response.write "Bad Request"
> >         Else
> >                 uId = Request.QueryString("u_id")
> >                 'uName = Request.QueryString("u_name")
> >                 test = Request.QueryString("t")
>
> >                 response.write "U id " & uId & "<BR>"' & "U name " & uName 
> > & "<BR>"
> > &
> >                 response.write "Test " & test
> >         End If
>
> > response.write "<script type=""text/javascript"">alert(""calling
> > postActivity"");postActivity();" & _
> > "</script>"
> > %>
> > ##########playvideo.asp############
>
> > ##########concat.js############
> > function postActivity()
> > {
> > var id = V_id.toString();
> > var name = V_name.toString();
> > var test1 = test.toString();
>
> > alert ("id in PostAct " + id);
> > alert ("Name in PostAct " + name);
> > alert ("test in PostAct " + test1);}
>
> > ##########concat.js############
>
> > The codes in XML is working fine and giving me the details but when Im
> > trying to access these details
> > in the javascript function "postActivity()" (defined in concat.js &
> > used in ASP file), its giving me
> > "Undefined" variable in IE and similar error in FFox. But when I
> > declare the values for these
> > details variabled in the "playVideo.file", which is used in the ASP,
> > the postActivity() is returning
> > me the right data!!!!!
>
> > From these what Im getting is, the variables "V_id..." defined in XML
> > is different then "V_id..."
> > defined in the playVideo.file
>
> > Can anyone please help me out in this where I want to transfer the
> > Viewers details from XML file
> > to the JS function defined in the external JS file.
>
> > Thanks in advance,
>
> > Javed.- Ocultar texto entre aspas -
>
> - Mostrar texto entre aspas -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Implementing OpenSocial Containers" 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-container?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to