473,408 Members | 2,734 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.

Can I check the exact URL within an XMLHTTPRequest?

Hi,

My website has a feature where users can insert a list of URLs, and we
will save the URLs for them.

The problem is that I need to make sure the URL they inserted in the
exact one!
E.g.: Let's say the user inserted http://www.exampleURL.com - I need
to verify whether it's
http://www.exampleURL.com OR
http://exampleURL.com OR
http://www.exampleURL.com/home.asp
The user does not know the exact URL, but since it is important for me
know, I thought I will be able to perform an XMLHttpRequest to the
URL, and somehow find out the exact URL.

Is there a way to figure it out?

Thanks,
Gabi

Oct 12 '07 #1
4 2307
Gabriella said the following on 10/12/2007 3:57 AM:
Hi,

My website has a feature where users can insert a list of URLs, and we
will save the URLs for them.

The problem is that I need to make sure the URL they inserted in the
exact one!
E.g.: Let's say the user inserted http://www.exampleURL.com - I need
to verify whether it's
http://www.exampleURL.com OR
http://exampleURL.com OR
http://www.exampleURL.com/home.asp
The user does not know the exact URL, but since it is important for me
know, I thought I will be able to perform an XMLHttpRequest to the
URL, and somehow find out the exact URL.
That is precisely how <URL:http://validator.w3.org/checklinkdoes it.
Is there a way to figure it out?
<URL: http://jibbering.com/2002/4/httprequest.html>
Shows precisely how to do it.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 12 '07 #2
On Oct 12, 3:57 am, Gabriella <frohlin...@yahoo.comwrote:
Hi,

My website has a feature where users can insert a list of URLs, and we
will save the URLs for them.

The problem is that I need to make sure the URL they inserted in the
exact one!
E.g.: Let's say the user insertedhttp://www.exampleURL.com- I need
to verify whether it'shttp://www.exampleURL.comORhttp://exampleURL.comORhttp://www.exampleURL.com/home.asp
The user does not know the exact URL, but since it is important for me
And why is that important to you? I put it to you that it is
thoroughly unimportant if you are creating a database of links. In
the above case, you would store:

http://www.exampleURL.com/

Note the added slash, which eliminates an extra redirect. It doesn't
matter where that URI redirects today as it may change tomorrow. If
the site is dynamic, it may change every time you hit it.
know, I thought I will be able to perform an XMLHttpRequest to the
URL, and somehow find out the exact URL.
You can't. Redirects are transparent to client requests.

Oct 12 '07 #3
David Mark said the following on 10/12/2007 5:47 AM:
On Oct 12, 3:57 am, Gabriella <frohlin...@yahoo.comwrote:
<snip>
>know, I thought I will be able to perform an XMLHttpRequest to the
URL, and somehow find out the exact URL.

You can't. Redirects are transparent to client requests.
They are? Does the W3's link validator go back and forth from the server
or is it done client side?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 12 '07 #4
Randy Webb wrote:
David Mark said the following on 10/12/2007 5:47 AM:
>On Oct 12, 3:57 am, Gabriella <frohlin...@yahoo.comwrote:
>>know, I thought I will be able to perform an XMLHttpRequest to the
URL, and somehow find out the exact URL.
You can't. Redirects are transparent to client requests.

They are?
Yes, they are *with XHR*. This has been discussed before here, where
I was in the position of doing the testing and providing the answer.
Does the W3's link validator go back and forth from the server
or is it done client side?
The validation is all server-side of course.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Oct 12 '07 #5

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

Similar topics

8
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box...
10
by: test | last post by:
Hi, I want to asynchronously recieve large amount of data using XMLHTTPRequest. If it is possible, I would like to make a progress bar to show the user how the process is going. According to...
25
by: pamelafluente | last post by:
Hi Guys, I have the following HTML code which is doing a GET to a page, say MyUrl.aspx : <body> <form name="form1" method="get" action="MyUrl.aspx" id="form1"> <input type="hidden"...
7
by: pamelafluente | last post by:
The precious input given by Laurent, Martin, Benjamin about XMLHttpRequest in Javascript, has made me think that perhaps I could improve what I am currently doing by using Ajax. Let's make it...
18
by: Joel Hedlund | last post by:
Hi! The question of type checking/enforcing has bothered me for a while, and since this newsgroup has a wealth of competence subscribed to it, I figured this would be a great way of learning...
1
by: vocalise | last post by:
The title probably isn't very clear, but I haven't been able to find this problem (or I must be having problems figuring out which search strings to use) so I apologize if this has been addressed...
4
by: libsfan01 | last post by:
Hi all I want to have create a js function to use xmlhttprequest continously check a given url for any change in its value and then bring the contents of that page through. Here is my code so...
8
by: Chandra | last post by:
How do I programmatically (javascript) check if link is valid in html?
12
by: canabatz | last post by:
i got this php file 'check.php' that checks for changes ,and showing a counter for posts !! $show_data="SELECT * FROM bidding_main WHERE bid_id='$bid_id' ";...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
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...
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
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.