Just change the script to adjust a little

http://pastie.org/575168

HTH



Alex Mcauley
http://www.thevacancymarket.com
----- Original Message ----- 
From: "Krish" <[email protected]>
To: "Prototype & script.aculo.us" <[email protected]>
Sent: Friday, August 07, 2009 5:18 AM
Subject: [Proto-Scripty] Detecting failure


>
> This maybe a newbie questions but I am having some trouble with this.
>
> 1. I would like use prototype to make an ajax call to load a page ..
> grab a particular div target_div
> from that page and stick it into a destination div dest_div on this
> page.
>
>   $("#dest_div").load("load_test.html #target_div img");
>
> Is there something similar for prototype?
>
> 2. If load fails, I want to put some default content that can be on
> this page.
> I am having detecting load failure. The exception handlers in
> makeAjaxCall don't work properly.
> Whats the best way to detect failure in a cross browser way?
>
> Thanks in advance,
> Kris
>
> ------------------- my test page
> <html>
> <head>
>
> <script type="text/javascript" src="prototype-1.6.0.3.js"></script>
> <script type="text/javascript" >
>
> function makeAjaxCall()
> {
> alert();
> new Ajax.Request('./load_test.html?x=2345',
>   {
> method:'get',
> onSuccess: function(transport){
>   var response = transport.responseText || "no response text";
>   alert("Success! \n\n" + response);
> },
> //onFailure: function(){ alert('Failure: Something went wrong...') }
> onException: function(){ alert('Exception: Something went
> wrong...') }
>   });
> }
> </script>
> </head>
>
> <body onload="javascript:makeAjaxCall();">
> <div id="dest_div"></div>
>  original page.
> </body>
> </html>
> >
> 


--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to