By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,568 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,568 IT Pros & Developers. It's quick & easy.

About checking an existing URL

100+
P: 539
Is there a function on JavaScript that checks the specified url if it exists or not?

ergo,

while loading a page, the script must check first the other page if it exists, redirect if not exists.

The purpose is for the maintenance.....
If we will do changes etc for the website, we should remove that page(always checked) so that, any users that tries to access the site or its sub directories will be redirected to a specific page ( Site under maintenance ).....

This is what im thinking now..... any suggestions or links for tutorial will be appreciated....

looking forward to your replies experts,
sukatoa
Jul 10 '08 #1
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
Yeah, sure, just make an Ajax head request.
Jul 10 '08 #2

100+
P: 539
Yeah, sure, just make an Ajax head request.
Thanks for your reply, i don't know AJAX yet....

Can you post some recommended URLs that could teach me how to deal with it?

Im not sure on google's suggestions.....
Jul 11 '08 #3

acoder
Expert Mod 15k+
P: 16,027
For Ajax tutorials, see the Offsite Links sticky thread. For your specific problem, see this link (section "Does a URL exist?").

Note that this is the option client-side since you asked in this forum. You could also make an HTTP request server-side.
Jul 11 '08 #4

100+
P: 539
For Ajax tutorials, see the Offsite Links sticky thread. For your specific problem, see this link (section "Does a URL exist?").

Note that this is the option client-side since you asked in this forum. You could also make an HTTP request server-side.
I never thought that the content of that sticky thread have more tutorials about JavaScript
That URL really helped me.... thanks acoder.... :)

I got this Prototype API , is this the nice one to be used for beginners like me? or can you recommend another one that fits my level?

Thanks again for the url acoder....

sukatoa
Jul 11 '08 #5

acoder
Expert Mod 15k+
P: 16,027
You could use that. Another popular one is jQuery and there are others. If you're a beginner to JavaScript, be sure to use one with good documentation/tutorials.
Jul 11 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.