Hi,

Can you provide more information about the gadget?  For instance, can you
provide the Gadget XML so that we can verify that you are using the
<UserPref> tag and you have <Required> set prefs.

Also, I can't see it in your code, but I am assuming that you
have initialized your prefs variable with the following:

var prefs = new gadgets.Prefs();

Additionally you are alerting the variable "num_entries" but that is not
defined or set anywhere either in your example.  You would have to do
something along the lines of:

var num_entries = prefs.get("num_entrie");

More information can be found at
http://code.google.com/apis/gadgets/docs/fundamentals.html#Datatypes

Thanks,
Paul

On Fri, Mar 5, 2010 at 11:34 AM, aslum <[email protected]> wrote:

> Hi,
>
> I am trying to take a user preference value thru jason....But i am
> facing problem in saving the set pref.set..its not storing..It will be
> greatly helpful...if anyone can tell me wats the pbm
>
>  function makeJSONRequest() {
>     alert("1 is called");
>      var params = {};
>      params[gadgets.io.RequestParameters.CONTENT_TYPE] =
> gadgets.io.ContentType.JSON;
>      // This URL returns a JSON-encoded string that represents a
> JavaScript object
>      var url = "http://jsonfeed.googlecode.com/files/jsonentry.txt";;
>      gadgets.io.makeRequest(url, callback, params);
>    };
>    function callback(obj) {
>    alert("2 is called");
>       var jsondata  = obj.data;
>       for (var key in jsondata){
>       var nument = jsondata[key];
>       }
>       alert("nument  is " + nument  + ".");
>          prefs.set("num_entries",nument);
>          alert("num_entries  is " + num_entries  + ".");
>
> --
> You received this message because you are subscribed to the Google Groups
> "iGoogle Developer Forum" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-gadgets-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/Google-Gadgets-API?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"iGoogle 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/Google-Gadgets-API?hl=en.

Reply via email to