473,785 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Part of URL is getting discarded

How do I find where I am screwing up?

Using the following in Eudora, and equivalent links elsewhere, the URLs with
the # get truncated just before the #.

<a href="http://www.standards.c om/links.html?Fail ureToDeleteTool bar"
eudora="autourl ">http://www.standards.c om/links.html?Fail ureToDeleteTool bar<
br><br>
</a><a href="http://www.standards.c om/links.html#Fail ureToDeleteTool bar"
eudora="autourl ">http://www.standards.c om/links.html#Fail ureToDeleteTool bar<
br><br>
</a><a href="http://www.standards.c om/links.html?Howa rdKaikow"
eudora="autourl ">http://www.standards.c om/links.html?Howa rdKaikow<br><br >
</a><a href="http://www.standards.c om/links.html#Howa rdKaikow"
eudora="autourl ">http://www.standards.c om/links.html#Howa rdKaikow<br><br >

If I include alert(location. href), the URL is truncated on input to the
script.
For example, http://www.standards.com/links.html#...oDeleteToolbar gets
truncated to http://www.standards.com/links.html.
No problem if a ? is used instead of a #.

However, the following does not truncate the URL.

<p><a
href="links.htm l#FailureToDele teToolbar">#Fai lureToDeleteToo lbar</a></p>
<p><a
href="links.htm l?FailureToDele teToolbar">?Fai lureToDeleteToo lbar</a></p>

I expect that I am doing something wrong.
Any pointers?

function CompareBookmark s(bmkTarget)
{
return (locSearch== bmkTarget.toLow erCase());
}
var locHash=locatio n.hash.toLowerC ase().slice(1);
var locSearch=locat ion.search.toLo werCase().slice (1);
var lenHash=locHash .length;
var lenSearch=locSe arch.length;
var blnStatus=Boole an(false);
alert(location. href);
if((lenHash != 0) && (lenSearch != 0) || ((lenHash + lenSearch) == 0))
{
blnStatus = false;
}
else
{
blnStatus = true;
if(lenSearch == 0)
{
locSearch = locHash;
}
}
if (blnStatus)
{
if(CompareBookm arks("HowardKai kow")){
location.replac e("HowardKaikow .html");
}
else if(CompareBookm arks("HowardKai kowServices")){
location.replac e("HowardKaikow Services.html") ;
}
else if(CompareBookm arks("SortPerfo rmanceCompariso n")){
location.replac e("Sorting/SortPerformance Comparison-Description.htm l");
}
else if(CompareBookm arks("ThisandTh at")){
location.replac e("index.html#T hisandThat");
}
else if(CompareBookm arks("CopyFileT oPrinter")){
location.replac e("ThisAndTha t/CopyFileToPrint er.html");
}
else if(CompareBookm arks("WordVBABo oks")){
location.replac e("OhMyWord/WordVBABooks.ht m");
}
else if(CompareBookm arks("WordBasic Books")){
location.replac e("OhMyWord/WordBasicBooks. htm");
}
else if(CompareBookm arks("FailureTo DeleteToolbar") ){
location.replac e("OhMyWord/VBABugsFeatures/FailureToDelete Toolbar.html");
}
else if(CompareBookm arks("SetRefere nceInWordProjec t")){
location.replac e("OhMyWord/SetReferenceInW ordProject.html ");
}
else {
alert(location. href + " is not a valid URL.\n" +
"You will be taken to http://www.standards.c om/index.html.");
location.replac e("index.html") ;
}
}
else {
alert(location. href + " is not a valid URL.\n" +
"You will be taken to http://www.standards.c om/index.html.");
location.replac e("index.html") ;
}


--
http://www.standards.com/; See Howard Kaikow's web site.
Jul 23 '05 #1
17 2083
"Howard Kaikow" <ka****@standar ds.com> wrote in message
news:ck******** **@pyrite.mv.ne t...
How do I find where I am screwing up?

Using the following in Eudora, and equivalent links elsewhere, the URLs with the # get truncated just before the #.

<a href="http://www.standards.c om/links.html?Fail ureToDeleteTool bar"
eudora="autourl ">http://www.standards.c om/links.html?Fail ureToDeleteTool bar< br><br>
</a><a href="http://www.standards.c om/links.html#Fail ureToDeleteTool bar"
eudora="autourl ">http://www.standards.c om/links.html#Fail ureToDeleteTool bar< br><br>
</a><a href="http://www.standards.c om/links.html?Howa rdKaikow"
eudora="autourl ">http://www.standards.c om/links.html?Howa rdKaikow<br><br >
</a><a href="http://www.standards.c om/links.html#Howa rdKaikow"
eudora="autourl ">http://www.standards.c om/links.html#Howa rdKaikow<br><br >

If I include alert(location. href), the URL is truncated on input to the
script.
For example, http://www.standards.com/links.html#...oDeleteToolbar gets truncated to http://www.standards.com/links.html.
No problem if a ? is used instead of a #.

However, the following does not truncate the URL.

<p><a
href="links.htm l#FailureToDele teToolbar">#Fai lureToDeleteToo lbar</a></p>
<p><a
href="links.htm l?FailureToDele teToolbar">?Fai lureToDeleteToo lbar</a></p>

I expect that I am doing something wrong.
Any pointers?

function CompareBookmark s(bmkTarget)
{
return (locSearch== bmkTarget.toLow erCase());
}
var locHash=locatio n.hash.toLowerC ase().slice(1);
var locSearch=locat ion.search.toLo werCase().slice (1);
var lenHash=locHash .length;
var lenSearch=locSe arch.length;
var blnStatus=Boole an(false);
alert(location. href);
if((lenHash != 0) && (lenSearch != 0) || ((lenHash + lenSearch) == 0))
{
blnStatus = false;
}
else
{
blnStatus = true;
if(lenSearch == 0)
{
locSearch = locHash;
}
}
if (blnStatus)
{
if(CompareBookm arks("HowardKai kow")){
location.replac e("HowardKaikow .html");
}
else if(CompareBookm arks("HowardKai kowServices")){
location.replac e("HowardKaikow Services.html") ;
}
else if(CompareBookm arks("SortPerfo rmanceCompariso n")){
location.replac e("Sorting/SortPerformance Comparison-Description.htm l");
}
else if(CompareBookm arks("ThisandTh at")){
location.replac e("index.html#T hisandThat");
}
else if(CompareBookm arks("CopyFileT oPrinter")){
location.replac e("ThisAndTha t/CopyFileToPrint er.html");
}
else if(CompareBookm arks("WordVBABo oks")){
location.replac e("OhMyWord/WordVBABooks.ht m");
}
else if(CompareBookm arks("WordBasic Books")){
location.replac e("OhMyWord/WordBasicBooks. htm");
}
else if(CompareBookm arks("FailureTo DeleteToolbar") ){
location.replac e("OhMyWord/VBABugsFeatures/FailureToDelete Toolbar.html");
}
else if(CompareBookm arks("SetRefere nceInWordProjec t")){
location.replac e("OhMyWord/SetReferenceInW ordProject.html ");
}
else {
alert(location. href + " is not a valid URL.\n" +
"You will be taken to http://www.standards.c om/index.html.");
location.replac e("index.html") ;
}
}
else {
alert(location. href + " is not a valid URL.\n" +
"You will be taken to http://www.standards.c om/index.html.");
location.replac e("index.html") ;
}


--
http://www.standards.com/; See Howard Kaikow's web site.

Jul 23 '05 #2
"Howard Kaikow" <ka****@standar ds.com> wrote in message
news:ck******** **@pyrite.mv.ne t...
How do I find where I am screwing up?

Using the following in Eudora, and equivalent links elsewhere, the URLs with the # get truncated just before the #.

<a href="http://www.standards.c om/links.html?Fail ureToDeleteTool bar"
eudora="autourl ">http://www.standards.c om/links.html?Fail ureToDeleteTool bar< br><br>
</a><a href="http://www.standards.c om/links.html#Fail ureToDeleteTool bar"
eudora="autourl ">http://www.standards.c om/links.html#Fail ureToDeleteTool bar< br><br>
</a><a href="http://www.standards.c om/links.html?Howa rdKaikow"
eudora="autourl ">http://www.standards.c om/links.html?Howa rdKaikow<br><br >
</a><a href="http://www.standards.c om/links.html#Howa rdKaikow"
eudora="autourl ">http://www.standards.c om/links.html#Howa rdKaikow<br><br >

If I include alert(location. href), the URL is truncated on input to the
script.
For example, http://www.standards.com/links.html#...oDeleteToolbar gets truncated to http://www.standards.com/links.html.
No problem if a ? is used instead of a #.

However, the following does not truncate the URL.

<p><a
href="links.htm l#FailureToDele teToolbar">#Fai lureToDeleteToo lbar</a></p>
<p><a
href="links.htm l?FailureToDele teToolbar">?Fai lureToDeleteToo lbar</a></p>

I expect that I am doing something wrong.
Any pointers?

For me these all returned the entire link.

<html>
<head>
<title>HK.htm </title>
<script type="text/javascript">
alert(location. href)
</script>
</head>
<body>
<br><a href="http://localhost/HK.htm#Test">ht tp://localhost/HK.htm#Test</a>
<br><a href="http://localhost/HK.htm?Test">ht tp://localhost/HK.htm?Test</a>
<br><a href="HK.htm#Te st">HK.htm#Test </a>
<br><a href="HK.htm?Te st">HK.htm?Test </a>
</html>
Jul 23 '05 #3
"McKirahan" <Ne**@McKirahan .com> wrote in message
news:zC_9d.3634 82$Fg5.201272@a ttbi_s53...
</a><a href="http://www.standards.c om/links.html#Fail ureToDeleteTool bar"
</a><a href="http://www.standards.c om/links.html#Howa rdKaikow"
For example, http://www.standards.com/links.html#...oDeleteToolbar For me these all returned the entire link.


THe only ones that fail for me are those above.

For example, all links in http://www.standards.com/testrefs.html work, or
not, as expected.

Sumptin's not right somewhere.

<html>
<head>
<title>HK.htm </title>
<script type="text/javascript">
alert(location. href)
</script>
</head>
<body>
<br><a href="http://localhost/HK.htm#Test">ht tp://localhost/HK.htm#Test</a> <br><a href="http://localhost/HK.htm?Test">ht tp://localhost/HK.htm?Test</a> <br><a href="HK.htm#Te st">HK.htm#Test </a>
<br><a href="HK.htm?Te st">HK.htm?Test </a>
</html>

Jul 23 '05 #4
Lee
Howard Kaikow said:

"McKirahan" <Ne**@McKirahan .com> wrote in message
news:zC_9d.363 482$Fg5.201272@ attbi_s53...
> </a><a href="http://www.standards.c om/links.html#Fail ureToDeleteTool bar"
> </a><a href="http://www.standards.c om/links.html#Howa rdKaikow"
> For example, http://www.standards.com/links.html#...oDeleteToolbar

For me these all returned the entire link.


THe only ones that fail for me are those above.

For example, all links in http://www.standards.com/testrefs.html work, or
not, as expected.


All of them that are valid URL's work fine for me in Firefox.
Some that are not valid are:
#NoSuchBookmark
?HowardKaikow#H owardKaikow
#HowardKaikow?H owardKaikow

Jul 23 '05 #5
On 9 Oct 2004 21:57:24 -0700, Lee <RE************ **@cox.net> wrote:

[snip]
Some that are not valid are:
#NoSuchBookmark
?HowardKaikow#H owardKaikow
I'm not sure if that is invalid. According to a quick read of RFC 2396[1],
that URI would refer to the current resource with a respecified query
string and fragment identifier. Still, it should probably be avoided just
like the empty URI. Whilst IE does apply "?query" properly (though not
""), NN4 doesn't and other browsers might fail, too.
#HowardKaikow?H owardKaikow


This is certainly invalid. If a fragment identifier is specified, it
should be the last part of the URI.

Mike
[1] Currently a draft standard, but I expect earlier standards agree here.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #6
"Lee" <RE************ **@cox.net> wrote in message
news:ck******** *@drn.newsguy.c om...
Howard Kaikow said:
For example, all links in http://www.standards.com/testrefs.html work, ornot, as expected.


All of them that are valid URL's work fine for me in Firefox.
Some that are not valid are:
#NoSuchBookmark
?HowardKaikow#H owardKaikow
#HowardKaikow?H owardKaikow


Yes, the script specifically disallows the above 3. The ones in
testhref.html all work as expected.
What I do not understand is why the following two fail:

<a href="http://www.standards.c om/links.html#Fail ureToDeleteTool bar"</a>
</a><a href="http://www.standards.c om/links.html#Howa rdKaikow"</a>

I can understand if we found an error in the script, but
alert(location. href) returns a truncated URL upon entering the script for
the two cases above. So the issue boils down to, why is the URL getting
truncated?
Jul 23 '05 #7
"Michael Winter" <M.******@bluey onder.co.invali d> wrote in message
news:opsfndk3ii x13kvk@atlantis ...
On 9 Oct 2004 21:57:24 -0700, Lee <RE************ **@cox.net> wrote:

[snip]
Some that are not valid are:
#NoSuchBookmark
?HowardKaikow#H owardKaikow


I'm not sure if that is invalid. According to a quick read of RFC 2396[1],
that URI would refer to the current resource with a respecified query
string and fragment identifier. Still, it should probably be avoided just
like the empty URI. Whilst IE does apply "?query" properly (though not
""), NN4 doesn't and other browsers might fail, too.
#HowardKaikow?H owardKaikow


This is certainly invalid. If a fragment identifier is specified, it
should be the last part of the URI.


My script excludes any URL with both a # and a ? because those would not be
valid for redirections I am doing.
Jul 23 '05 #8
To simplify isolating the problem, I've created the following test.

Using http://www.standards.com/test.html, I find that ALL URLs that have a #
get truncated by location .href (see
http://www.standards.com/testlinnks.html).
Jul 23 '05 #9
"Howard Kaikow" <ka****@standar ds.com> wrote in message
news:ck******** **@pyrite.mv.ne t...
To simplify isolating the problem, I've created the following test.

Using http://www.standards.com/test.html, I find that ALL URLs that have a # get truncated by location .href (see
http://www.standards.com/testlinnks.html).

http://www.standards.com/testlinnks.html should have been
http://www.standards.com/testlinks.html.

I just tried from IE 4 on an old Win 95 system, same problem, location.href
truncates the # and anything to the right.
Normally, I (ab)use IE 6 on Win 2000.

Could this be an Apache server issue??
Jul 23 '05 #10

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

Similar topics

8
22243
by: mimages | last post by:
Can someone tell me how to parse part of a string? I can use the following: <?php $text = $_SERVER; //$PHP_SELF //(document.url); echo $text; ?> to get this result: "Your currently at /test.php "
7
2649
by: Robert Ferber | last post by:
Hi, I can't find any good documentation about the Python-database module, all I found was this rudimentary (no examples, no references) piece here: http://www.python.org/peps/pep-0249.html Anyway, this and also this tutorial here: http://www.devshed.com/c/a/Python/MySQL-Connectivity-With-Python/2/
2
2780
by: Hartmut Sbosny | last post by:
Hello, I get the linker message `.gnu.linkonce.t._ZN3TNT12CurveTntPlotIdE6handleEi' referenced in section `.rodata' of FollowCurveWindow.o: defined in discarded section `.gnu.linkonce.t._ZN3TNT12CurveTntPlotIdE6handleEi' of FollowCurveWindow.o i.e. of the structur
5
2724
by: Rick | last post by:
I wrote the following code as part of a page where users can reorder a list of items by highlighting an item in a list box and clicking an "up" or "down" button to move the items around. The code below is for the up and down buttons along with a reset button (which reloads the list as it was originally) and a change button which applies the changes. In Explorer and Safari for Mac, this code works flawlessly. When I tested on Explorer in...
1
3347
by: jimfortune | last post by:
From: http://groups-beta.google.com/group/comp.databases.ms-access/msg/769e67e3d0f97a90?hl=en& Errata: 19 solar years = 2939.6018 days should be 19 solar years = 6939.6018 days Easter Function explanation Part II
3
4344
by: Bruce Wolfe | last post by:
We are having a problem with firewalls. We can't pinpoint the exact problem but the working theory at this point is the request from the client software is reaching the server through port 80. The response from the server is not making it back because the return port back to the client software being blocked by the firewall. This seems to be an intermittent problem because some of the ports are open through the firewall and some are not....
5
1490
by: cbranje | last post by:
Lets say I have two clients behind NAT(router) that know each others routers global address. I'm woundering if I set up a tcplistener (or maybe UDP scoket( on both clients, and a tcpclient on both clients could I tunnel through to each using the following: 1. Client A starts listening and attemps to connect to Client B's global IP which will discarded by the firewall of B. 1. Client B also attemps to connect to A, and am I correct in...
1
1669
by: Tedmond | last post by:
Dear all, How to prevent a datagrid in Windows form getting focus? Even user click on it. I use barcode scanner as input and display the result in a datagrid. My problem is when the datagrid got focus, the scanner input will be discarded. I cannot find any event to handle the input. Thanks,
2
2241
by: kaka | last post by:
I am developping a sns site. I was wondering if i send user's email addresses as a part of confirmation link so that when a user receives the confirmation email, he can just click on the link to login to our site without punching in the password.
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.