Hi!
@anwii
There are a couple of different approaches that you could try. You can use a client-side approach and create a Javascript that makes an AJAX request to determine if a particular page exists on the server. The request is make to retrieve the directory, which basically means that the default document within that directory is retrieved. If it gets back an error response, we assume that the directory does not exist and can display a message to the user, again via Javascript. The advantage of this approach is that the page does not refresh. We can accomplish something similar using inline frames - the user would see an error within the inline frame while the textbox for entering the directory is still visible... it is a crude approach, but it gets the job done with AJAX.
From the server-side, you could implement a solution with any programming language of choice, such as PHP, Java, or ASP.NET. What you are trying to accomplish is pretty much what many MVC frameworks do - when you type in a directory name in the URL bar, the server-side script that makes up the MVC framework checks to see if it can find a controller and view to match and then either displays the page or goes BEEEP... wrong answer! You can specify a custom error page to say Page Not Found or something similar. However, I'm not really sure if you are trying to create your own web development framework or are simply developing something to enable visitors to browse through the site, so if you can provide more details about what you are trying to accomplish, that would really help us in telling you the exact course that you need to follow to achieve your end result.
| |
|
Welcome to KnowledgeSutra - Dear Guest | |
A Brainstorming Question...
Started by anwiii, Apr 11 2010 07:17 AM
10 replies to this topic
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














