Hi,
The only error I was in your code was missing declaration of
activity_params. It worked fine for me in Code Runner. Here is my
version of the code that ran in Code Runner


function createActivity() {
var title= '';
title = ', Title ';
alert(1);
var activity_params={};
activity_params[opensocial.Activity.Field.TITLE] = title;
activity_params[opensocial.Activity.Field.BODY] = "<h1>Body</
h1><i>Hello World</i>";
var activity = opensocial.newActivity(activity_params);
alert(activity);
opensocial.requestCreateActivity(activity, "HIGH",
getCreateActivityResp);

}

function getCreateActivityResp(responseItem) {
console.log(responseItem);
var htmlout = '';
if(responseItem.hadError()){
//htmlout= 'has error: ' + responseItem.ErrorMessage;
//alert(responseItem.ErrorMessage +'has error');

}

else{
alert('create activity good!')

}
}

createActivity();

Could you try this and let me know?

Thanks,
Rohit

On Jun 4, 5:56 am, sharath <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I tried adding this line below the title code, its not working.
> Now the code is as below:
>
> function createActivity() {
> var title= '';
> title = ', Title ';
> alert(1);
> activity_params[opensocial.Activity.Field.TITLE] = title;
> activity_params[opensocial.Activity.Field.BODY] = "<h1>Body</
> h1><i>Hello World</i>";
> var activity = opensocial.newActivity(activity_params);
> alert(activity);
> opensocial.requestCreateActivity(activity, "HIGH",
> getCreateActivityResp);
>
> }
>
> function getCreateActivityResp(responseItem) {
> console.log(responseItem);
> var htmlout = '';
> if(responseItem.hadError()){
> //htmlout= 'has error: ' + responseItem.ErrorMessage;
> //alert(responseItem.ErrorMessage +'has error');
>
> }
>
> else{
> alert('create activity good!')
>
> }
> }
>
> createActivity();
>
> On Jun 3, 9:38 pm, "Rohit Ghatol" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > The only line of code you would need to add is the following -
> >   activity_params[opensocial.Activity.Field.BODY] = "<h1>Body</h1><i>Hello
> > World</i>";
>
> > Also, the hyper link to the application automatically appears in the updates
> > section of Orkut, you don't need to explicitly put it.
>
> > Hope this helps.
>
> > Best,
> > Rohit
>
> > Google Developer Programs
>
> > On Tue, Jun 3, 2008 at 9:28 AM, Rohit Ghatol <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > > The only line of code you would need to add is the following -
> > >   activity_params[opensocial.Activity.Field.BODY] = "<h1>Body</h1><i>Hello
> > > World</i>";
>
> > > Also, the hyper link to the application automatically appears in the
> > > updates section of Orkut, you don't need to explicitly put it.
>
> > > Hope this helps.
>
> > > Best,
> > > Rohit
>
> > > Google Developer Programs
>
> > > Join us at Google's biggest developer event of the year
> > > May 28-29, San Francisco
> > >http://code.google.com/events/io
>
> > > On Tue, Jun 3, 2008 at 7:04 AM, sharath <[EMAIL PROTECTED]> wrote:
>
> > >> Hello,
>
> > >> I have the following activity stream code
>
> > >> function createActivity() {
> > >> var title= '';
> > >> title = ', Title ';
> > >> alert(1);
> > >> activity_params[opensocial.Activity.Field.TITLE] = title;
> > >> var activity = opensocial.newActivity(activity_params);
> > >> alert(activity);
> > >> opensocial.requestCreateActivity(activity, "HIGH",
> > >> getCreateActivityResp);
> > >> }
> > >> function getCreateActivityResp(responseItem) {
> > >> console.log(responseItem);
> > >> var htmlout = '';
> > >> if(responseItem.hadError()){
> > >> //htmlout= 'has error: ' + responseItem.ErrorMessage;
> > >> //alert(responseItem.ErrorMessage +'has error');
> > >> }
> > >> else{
> > >> alert('create activity good!')
> > >> }
> > >> }
> > >> createActivity();
>
> > >> I need to include the body also along with the title in the above
> > >> code.
> > >> In the body I should put the hyperlink to the application.
> > >> Can anyone suggest the modification to include the body in the above
> > >> code.?
>
> > >> Thanks and Regards
> > >> Sharath
--~--~---------~--~----~------------~-------~--~----~
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