Finding out if a HTML page in a foreign domain exists before youallow navigation to it

S

Stevo

Does anyone know of a way to check if a html file exists in a different
domain so that you can know in advance whether going there would result
in a 404? I believe Ajax would allow that in the same domain, but
wouldn't in a different domain. The page I might go to is totally out of
my control, so I can't do anything that side. I'm expecting this won't
be possible, but figured I'd ask.
 
S

Stevo

Randy said:
Stevo said the following on 2/22/2008 11:37 AM:

No. Not on an internet site anyway. I could dream up a way to do it
running locally though.

Thanks, figured as much.
 
J

John Nagle

Stevo said:
Does anyone know of a way to check if a html file exists in a different
domain so that you can know in advance whether going there would result
in a 404? I believe Ajax would allow that in the same domain, but
wouldn't in a different domain. The page I might go to is totally out of
my control, so I can't do anything that side. I'm expecting this won't
be possible, but figured I'd ask.

If it's a page on a server you control, you could have a link-checking
process on the server which checked your pages and disabled broken links.
That's entirely on the server side.

If it's on a client you control, you could write a Greasemonkey script
to check links on each page as it is loaded. But the overhead would be
high.

What are you trying to do?

John Nagle
SiteTruth
 
A

adamcbrz

    If it's a page on a server you control, you could have a link-checking
process on the server which checked your pages and disabled broken links.
That's entirely on the server side.

    If it's on a client you control, you could write a Greasemonkey script
to check links on each page as it is loaded.  But the overhead would be
high.

    What are you trying to do?

                                        John Nagle
                                        SiteTruth

this can be accoplished with Ajax, PHP, & Curl. Curl is an extention
for php. With it you can retieve alot a information on a site/page
including the status.

Hope that helps!
Adam
 
S

Stevo

John said:
If it's a page on a server you control, you could have a link-checking
process on the server which checked your pages and disabled broken links.
That's entirely on the server side.

Sadly it's not :(
If it's on a client you control, you could write a Greasemonkey script
to check links on each page as it is loaded. But the overhead would be
high.

What are you trying to do?

I was asked if I could provide some JavaScript that could check whether
a regular link to a different site would result in a 404. I said that I
was 99% sure it couldn't be done but I'd ask around.
 
S

Stevo

this can be accoplished with Ajax, PHP, & Curl. Curl is an extention
for php. With it you can retieve alot a information on a site/page
including the status.
Hope that helps!
Adam

Unfortunately I would only have Javascript available for this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top