Hi again,

Sorry for double-posting, but you might also consider loading the
scripts a different way[1], since you're using a GET operation
anyway.  (You can encode the parameters in the URL using
Hash.toQueryString[2].)

The advantage to doing them that way is that if you add functions to
the "global namespace" (the window object) and they're written in the
standard "function xyz() { ... }" way, they'll get added to the
namespace; with eval'd scripts, they won't; you have to write them
like this: "xyz = function() { ... }", a trick that takes advantage of
the Horror of Implicit Globals[3].  Using a script tag, you don't have
to play those games.

[1] http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically
[2] http://www.prototypejs.org/api/hash/toQueryString
[3] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to