[mochikit] Re: How prepend a prefix like /myapp/ to all URLs in MochiKit/Javascript?

2008-01-15 Thread Bob Ippolito

Write your own function? I guess all XHR requests go through doXHR at
some point, so you could swap it out with something else. Something
like this might work:

MochiKit.Async._old_doXHR = MochiKit.Async.doXHR;
doXHR = MochiKit.Async.doXHR = function (url) {
return MochiKit.Async._old_doXHR.apply(MochiKit.Async,
extend(['/myapp/' + url], arguments, 1));
};

-bob

On Jan 14, 2008 11:42 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

 I'm happily using MochiKit in TurboGears.   TurboGears has a nice
 setting to add prefixes to all URLs (server.webpath).

 For example, for server.webpath = /myapp:

 /a - /myapp/a
 /b - /myapp/b

 etc.

 This does *not* seem to affect Javascript code.

 Anyway to do something similar in my MochiKit/Javascript code?

 Chris

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] How prepend a prefix like /myapp/ to all URLs in MochiKit/Javascript?

2008-01-15 Thread [EMAIL PROTECTED]

I'm happily using MochiKit in TurboGears.   TurboGears has a nice
setting to add prefixes to all URLs (server.webpath).

For example, for server.webpath = /myapp:

/a - /myapp/a
/b - /myapp/b

etc.

This does *not* seem to affect Javascript code.

Anyway to do something similar in my MochiKit/Javascript code?

Chris

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---