[Proto-Scripty] Re: Ajax.Request and text/javascript = syntax errors in javascript

2008-11-07 Thread T.J. Crowder

Hi,

You're looking for the onException callback[1].  If an exception
occurs during script evaluation (or for any other reason during the
processing of the request), onException is called.  You might want to
check ou the Bulletproof Ajax Requests How To in the unofficial
wiki[2], although what's there so far is just a start.

[1] http://prototypejs.org/api/ajax/options
[2] http://proto-scripty.wikidot.com/prototype:how-to-bulletproof-ajax-requests

HTH,
--
T.J. Crowder
tj / crowder software / com

On Nov 7, 2:14 pm, jaap.taal [EMAIL PROTECTED] wrote:
 That's not what I want.

 I want to serve text/javascript but when I'm using a dynamically
 generated script which contains syntax errors I'm not notified by
 Prototype.

 On Nov 6, 8:57 pm, Diodeus [EMAIL PROTECTED] wrote:

  Serve it as text/html.

  On Nov 6, 2:06 pm, jaap.taal [EMAIL PROTECTED] wrote:

   I'm using Ajax.Request and receive a text/javascript content-type, but
   sometimes I make a syntax error in my javascript. The error is now
   silently ignored (at least that's what I think). Using firebug it
   doesn't show in my console window.

       new Ajax.Request('myscript.php', {
               method:'get',
               paramters: {...}
       });

   Response:
   HTTP/1.1 200 OK
   Date: Thu, 06 Nov 2008 18:56:06 GMT
   Server: Apache/2.2.9 (Debian) PHP/5.2.6-5 with Suhosin-Patch
   X-Powered-By: PHP/5.2.6-5
   Set-Cookie: PHPSESSID=...; path=/
   Content-Length: 195
   Connection: close
   Content-Type: text/javascript

   alert('testing';

   How can I trap this error when I'm using prototype??


--~--~-~--~~~---~--~~
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-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Ajax.Request and text/javascript = syntax errors in javascript

2008-11-07 Thread jaap.taal

That's not what I want.

I want to serve text/javascript but when I'm using a dynamically
generated script which contains syntax errors I'm not notified by
Prototype.

On Nov 6, 8:57 pm, Diodeus [EMAIL PROTECTED] wrote:
 Serve it as text/html.

 On Nov 6, 2:06 pm, jaap.taal [EMAIL PROTECTED] wrote:

  I'm using Ajax.Request and receive a text/javascript content-type, but
  sometimes I make a syntax error in my javascript. The error is now
  silently ignored (at least that's what I think). Using firebug it
  doesn't show in my console window.

      new Ajax.Request('myscript.php', {
              method:'get',
              paramters: {...}
      });

  Response:
  HTTP/1.1 200 OK
  Date: Thu, 06 Nov 2008 18:56:06 GMT
  Server: Apache/2.2.9 (Debian) PHP/5.2.6-5 with Suhosin-Patch
  X-Powered-By: PHP/5.2.6-5
  Set-Cookie: PHPSESSID=...; path=/
  Content-Length: 195
  Connection: close
  Content-Type: text/javascript

  alert('testing';

  How can I trap this error when I'm using prototype??
--~--~-~--~~~---~--~~
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-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---