Re: [Proto-Scripty] how to update HTML with Ajax.Request

2010-03-18 Thread Franck WATTEAU
For IE, you must put action between  '.

function addToFavorite(quizSeq)
{
 new Ajax.Request('/my/user-quizzes/processRequest',
   {
 method:'get',
 parameters: { 'action':'addtofavorite', quiz_seq:quizSeq},
 onSuccess: function(transport){
 var response = transport.responseText || "no response text";
document.getElementById(rating).innerHTML = "Thanks for rating
this quiz";
 },
 onFailure: function(){
 alert("Failed");
 }
   });

On Thu, Mar 18, 2010 at 9:26 PM, Zahid  wrote:

> Hi I am trying to use this code to update element in html but it
> does'nt seems to work...please help me out:
>
> function addToFavorite(quizSeq)
> {
>  new Ajax.Request('/my/user-quizzes/processRequest',
>{
>  method:'get',
>  parameters: { action:'addtofavorite', quiz_seq:quizSeq},
>  onSuccess: function(transport){
>  var response = transport.responseText || "no response text";
> document.getElementById(rating).innerHTML = "Thanks for rating
> this quiz";
>  },
>  onFailure: function(){
>  alert("Failed");
>  }
>});
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] how to update HTML with Ajax.Request

2010-03-18 Thread green
Can you use firebugs to check the response and request of the ajax call? Can
you add onException(e) {alert(e);} to check if there is any exception during
the call?

On Fri, Mar 19, 2010 at 7:26 AM, Zahid  wrote:

> Hi I am trying to use this code to update element in html but it
> does'nt seems to work...please help me out:
>
> function addToFavorite(quizSeq)
> {
>  new Ajax.Request('/my/user-quizzes/processRequest',
>{
>  method:'get',
>  parameters: { action:'addtofavorite', quiz_seq:quizSeq},
>  onSuccess: function(transport){
>  var response = transport.responseText || "no response text";
> document.getElementById(rating).innerHTML = "Thanks for rating
> this quiz";
>  },
>  onFailure: function(){
>  alert("Failed");
>  }
>});
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.