Hi,
Is it possible to test whether a given URL is reachable within using any server-side scripting?
Cheers,
Jon
7 3559
Hi,
Is it possible to test whether a given URL is reachable within using any server-side scripting?
Cheers,
Jon
1. synchronous ajaxing the url. a head request is the quickest.
2. use the domainOK function below to simply check on rules, not existence. -
function qualifyPath(paf) { var i = new Image; i.src = paf; return i.src; }
-
-
function domainOK(paf) {
-
var tlc = window.location;
-
var myDomain = tlc.hostname || tlc.host;
-
var paf3 = qualifyPath(paf);
-
var pafDomain = paf3.split(/^https?\:\/\//)[1].split(/\//)[0];
-
return myDomain == pafDomain; }
-
-
-
Btw, my original post should have read:
Hi,
Is it possible to test whether a given URL is reachable without using any server-side scripting?
Cheers,
Jon
The first option suggested by rnd me should work. For an example, see the section titled 'Does a URL exist?' on this page.
The servers I need to test are remote and this method only seems to work for local paths.
Cheers,
Jon
The servers I need to test are remote and this method only seems to work for local paths.
If they're from a different domain, then you will need some server-side code, but you said "without using any server-side scripting" so the answer would be that it's not possible.
Ok, thanks.
What would be easiest method of doing this with minimal server-side scripting?
Thanks,
Jon
Make an http request from your server-side script. All it has to return (print/echo) is 0 or 1 (or true/false). Then the Ajax script can check the response.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Steven Scaife |
last post by:
Below is my ASP page, I have changed the update to read DRIAL which doesn't
exist, shouldnt this throw an error, or if the connection cannot be made
shouldnt it throw an error as well
thanks in...
|
by: Nikola Bucic |
last post by:
Could someone tell me how can I constantly check if I'm connected to
internet and if possible to determine what type of connection is it.
My best shot wright now is to have a timer which will...
|
by: lawrence k |
last post by:
I've made it habit to check all returns in my code, and usually, on
most projects, I'll have an error function that reports error messages
to some central location. I recently worked on a project...
|
by: John |
last post by:
Hi
I am creating a db connection using the below code. Is there a way to check
if the connection is open?
Thanks
Regards
|
by: hakkatil |
last post by:
Hi to all,
I have a page that inserts excel sheet to access database. I am using asp. What I want to do is to check the inserting record if it is in the database. Basicly checking the dublicate...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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...
|
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...
|
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...
|
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,...
| |