MySpace Developer Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

Passing in variables to the Application Profile

Last post 07-26-2008 1:34 PM by Hart. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-23-2008 12:36 PM

    Passing in variables to the Application Profile

    I searched around the forums but couldn't find an answer to this...

    Is there any way to pass in variables to the Application Profile and save them?

     

    E.G.

     http://www.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=398806509&myvar=100

     

    Any way to save the value of myvar in this case?

     

    Thanks

  • 07-23-2008 4:22 PM In reply to

    Re: Passing in variables to the Application Profile

     I don't think you have any imperative control over the applications profile page, which means you can't write code behind or even muck with client-side code.  It's pretty much a black box, much like your own profile page is.  That being said, there may be a way to accomplish what you need.  What exactly are you trying to convey when you pass a variable to the application profile page and how is that relavant to your application?  Maybe another pattern or solution can still get you what you want.

  • 07-26-2008 1:34 PM In reply to

    • Hart
    • Top 500 Contributor
    • Joined on 07-09-2008
    • Posts 8

    Re: Passing in variables to the Application Profile

     Ok, I figured out how to pass in the data with a cookie, but now I need to save it--I'm using the following code to get/set some instance data, but it doesn't seem to be working... can somebody help?

     

    function updateEmbed(val)
    {
        if (opensocial.Person.isOwner())
        {
            var req = opensocial.newDataRequest();
            req.add(req.newUpdateInstanceAppDataRequest("embedtxt", val),"data");
            req.send(onDataSaved); //I can't see this request go through in TamperData

        }
        
    }
    function onDataSaved(){alert("Data Saved");//This never pops up}

    function loadData() {
      var req = opensocial.newDataRequest();
      req.add(req.newFetchInstanceAppDataRequest("embedtxt"),"data");
      req.send(onDataLoaded);
    };

    function onDataLoaded(returnData)
    {
     

        var dataObj = returnData.get("data");

    if (dataObj != undefined)
        {
            if (!dataObj.hadError())
            {
                var val = dataObj.getData()["embedtxt"];
                alert(val);
            }
        }

    }

     

    help!

Page 1 of 1 (3 items)