JSON url for PHP scripts

1 view
Skip to first unread message

Sudheer

unread,
Nov 24, 2009, 1:56:45 PM11/24/09
to MooTools Users
Hi,

I have a question regarding how to specify a URL for a JSON request.
Here is my directory structure

htdocs
|
|----members
| |---MyHome.php
| |---fetchMyOrders.php
|
|----common

My current JSON request looks like as follows and it works fine. (I
have provided only partial code here)
var ajaxRequest = new Request.JSON({
url: "fetchMyOrders.php",
method: 'get',
async: false,
.
.

I can move the file fetchMyOrders.php to "common" directory and change
the url part of the request to "../common/fetchMyOrders.php" and that
works too.

Now the question is, is there a way by which I can provide this path
in a more elegant way and not specify the whole "../common" part of
the URL? Actually I will put a lot of PHP scripts in that "common"
directory and I don't want anyone looking at my JS code to figure out
the directory structure of the server.

Thanks
Sudheer

Ryan Florence

unread,
Nov 24, 2009, 2:02:32 PM11/24/09
to mootool...@googlegroups.com
People can always see your javascript. This is a server/application
issue.

If it's one or two files of a simple application you could do some url
rewriting in an .htaccess file, but otherwise application routing is a
pretty big discussion outside the scope of the mootools group.

Ryan Florence

[Introducing MooDocs - become a better developer] ( http://blog.flobro.com/
)

Sudheer

unread,
Nov 24, 2009, 2:34:39 PM11/24/09
to MooTools Users

Sudheer

unread,
Nov 24, 2009, 2:39:39 PM11/24/09
to MooTools Users
Hi Ryan,

Thanks for the quick response. I think I will dig on some Apache
related forums.

Thanks
Sudheer

On Nov 24, 11:02 am, Ryan Florence <rpflore...@gmail.com> wrote:
> People can always see your javascript.  This is a server/application  
> issue.
>
> If it's one or two files of a simple application you could do some url  
> rewriting in an .htaccess file, but otherwise application routing is a  
> pretty big discussion outside the scope of the mootools group.
>
> Ryan Florence
>
> [Introducing MooDocs - become a better developer] (http://blog.flobro.com/
> > Sudheer- Hide quoted text -
>
> - Show quoted text -

אריה גלזר

unread,
Nov 25, 2009, 1:48:58 AM11/25/09
to mootool...@googlegroups.com
this would seem like a mission for htaccess (for apache) and not JS. lookup apache mod_rewrite
-----------
אריה גלזר
052-5348-561
5561
Reply all
Reply to author
Forward
0 new messages