473,408 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Checking if URL exists

Is there a way in JavaScript to test if a webpage exists, for example
before redirecting a browser window to that page?

What I am trying to do is customize an acknowledgement page for
particular users depending upon choices they make when completing a
form.
Jul 14 '07 #1
5 4831
On Jul 14, 9:48 am, Gargoyle <nob...@loadsarubbish.perswrote:
Is there a way in JavaScript to test if a webpage exists, for example
before redirecting a browser window to that page?
You can try to load it with AJAX.
What I am trying to do is customize an acknowledgement page for
particular users depending upon choices they make when completing a
form.
I don't understand what this has to do with the question.

Jul 14 '07 #2
On Sat, 14 Jul 2007 07:11:09 -0700, David Mark
<dm***********@gmail.comwrote:
>On Jul 14, 9:48 am, Gargoyle <nob...@loadsarubbish.perswrote:
>Is there a way in JavaScript to test if a webpage exists, for example
before redirecting a browser window to that page?

You can try to load it with AJAX.
>What I am trying to do is customize an acknowledgement page for
particular users depending upon choices they make when completing a
form.

I don't understand what this has to do with the question.
Basically, I wanted to test if the customized page existed before
redirecting the user to that page.
Jul 14 '07 #3
On Jul 14, 10:13 am, Gargoyle <nob...@loadsarubbish.perswrote:
On Sat, 14 Jul 2007 07:11:09 -0700, David Mark

<dmark.cins...@gmail.comwrote:
On Jul 14, 9:48 am, Gargoyle <nob...@loadsarubbish.perswrote:
Is there a way in JavaScript to test if a webpage exists, for example
before redirecting a browser window to that page?
You can try to load it with AJAX.
What I am trying to do is customize an acknowledgement page for
particular users depending upon choices they make when completing a
form.
I don't understand what this has to do with the question.

Basically, I wanted to test if the customized page existed before
redirecting the user to that page.
Why wouldn't it exist? Is it maintained by somebody else?

Jul 14 '07 #4
On Sat, 14 Jul 2007 07:22:14 -0700, David Mark
<dm***********@gmail.comwrote:
>
Why wouldn't it exist? Is it maintained by somebody else?
It should exist, but just in case the page/file had been deleted (for
an old customer) I wanted to be sure.
Jul 14 '07 #5
Gargoyle wrote on 14 jul 2007 in comp.lang.javascript:
On Sat, 14 Jul 2007 07:22:14 -0700, David Mark
<dm***********@gmail.comwrote:
>>
Why wouldn't it exist? Is it maintained by somebody else?

It should exist, but just in case the page/file had been deleted (for
an old customer) I wanted to be sure.
If you have access to serverside scripting,
make a dedicated 404.asp [or the php equivalent] file
that reports to you where a file does not exist
and the referrer page is from your own domain.

That some browsers do not give a correct referrer,
is not that important, you'll just miss a few.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 14 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Bart Nessux | last post by:
Are these equivelent? Is one approach prefered over the other #check to see if var contains something... if so proceed. if var is not None: continue #check to see if var is empty... if so...
3
by: Phil Lamey | last post by:
Hi Folks, I have run into a bit of an issue with checking for files. Some files reside on Server X and some on Server Y. The page with all the links is on Server X. If the file exists we...
5
by: Richard L Rosenheim | last post by:
What's the proper technique for checking for the existence of an attribute within a node? Lets say I did a SelectSingleNode which returned this element: <AnAddress city="San Francisco"...
5
by: BerkshireGuy | last post by:
Hello everyone, I have a bond form that a user uses to enter data. One of my fields, is PolicyNumber. I added some code on the Before Update event of txtPolicyNumber that checks to see if...
15
by: Geiregat Jonas | last post by:
is using if(open("file",O_EXCL) != -1){ printf("File does exists")}else{printf("file does not exists"); } a good way of checking if a file exists or not, if not how should I do it ?
4
by: Darrel | last post by:
I'm trying to add an extra layer of error checking on a Drop Down List. The list is populated from one table, and then I select the selectedValue from another DB. While it SHOULDN'T ever happen,...
9
by: D. Shane Fowlkes | last post by:
(ASP.NET 2 / VB) Question - How can I write a If statement to see if a control (textbox) actually exists on a page? Upon page_load, a certain control may or may not be visible on the page so I...
1
by: Edwina Rothschild | last post by:
Hello, I am new to PHP so I have done a research on how to check if an entry exists on the table. I came up with the following code: include("dbinfo.inc.php"); $Name=$_POST; $Code=$_POST;...
13
by: darkslide | last post by:
Hi, I'm checking if a file exists with the following code; If System.IO.File.Exists("C:\test.txt") = True Then MsgBox("File Exists") Else MsgBox("File Does Not Exist") End If ...
7
by: sprash | last post by:
Newbie question: I'm trying to determine if a file physically exists regardless of the permissions on it Using File.Exists() returns false if it physically exists but the process does not...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.