473,767 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URL Capture question resolved...need a tweak

DGS
Hi all...

Yesterday I asked about setting a cookie with an intially requested URL that
could be used later. I found the code to do it. For the code on the
login.html page I would like to tweak it to NOT be server specific. Here is
the code for the front end:

<SCRIPT LANGUAGE=JavaSc ript>
if(document.URL != "https://test2k301/pkmslogin.form" ){
document.cookie = ('Referrer_Page ='+document.URL )+'; path=/';
}
</SCRIPT>

Anybody know of a way I can make this work with JUST the path? Put in other
words...I'd like for it to check this to look for ONLY "/pkmslogin.form" .
However, I still want the cookie to always contain the full URL. This would
effectively make it so I didn't have to change the code to be server
specific for each server this gets copied to.
May 17 '07 #1
4 2485
DGS said the following on 5/17/2007 12:50 PM:
Hi all...

Yesterday I asked about setting a cookie with an intially requested URL that
could be used later. I found the code to do it. For the code on the
login.html page I would like to tweak it to NOT be server specific. Here is
the code for the front end:

<SCRIPT LANGUAGE=JavaSc ript>
if(document.URL != "https://test2k301/pkmslogin.form" ){
document.cookie = ('Referrer_Page ='+document.URL )+'; path=/';
}
</SCRIPT>

Anybody know of a way I can make this work with JUST the path? Put in other
words...I'd like for it to check this to look for ONLY "/pkmslogin.form" .
However, I still want the cookie to always contain the full URL. This would
effectively make it so I didn't have to change the code to be server
specific for each server this gets copied to.
if (document.URL.i ndexOf('/pkmslogin.form' ) != -1)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 17 '07 #2
DGS

"Randy Webb" <Hi************ @aol.comwrote in message
news:u6******** ************@gi ganews.com...
DGS said the following on 5/17/2007 12:50 PM:
>Hi all...

Yesterday I asked about setting a cookie with an intially requested URL
that could be used later. I found the code to do it. For the code on
the login.html page I would like to tweak it to NOT be server specific.
Here is the code for the front end:

<SCRIPT LANGUAGE=JavaSc ript>
if(document.UR L != "https://test2k301/pkmslogin.form" ){
document.cooki e = ('Referrer_Page ='+document.URL )+'; path=/';
}
</SCRIPT>

Anybody know of a way I can make this work with JUST the path? Put in
other words...I'd like for it to check this to look for ONLY
"/pkmslogin.form" . However, I still want the cookie to always contain the
full URL. This would effectively make it so I didn't have to change the
code to be server specific for each server this gets copied to.

if (document.URL.i ndexOf('/pkmslogin.form' ) != -1)
Hmmm...somewher e along the lines this is breaking the functionality and
causing the cookie to get set when /pkmslogin.form is the path...which is
the why the if check is in place...
May 17 '07 #3
DGS said the following on 5/17/2007 2:08 PM:
"Randy Webb" <Hi************ @aol.comwrote in message
news:u6******** ************@gi ganews.com...
>DGS said the following on 5/17/2007 12:50 PM:
>>Hi all...

Yesterday I asked about setting a cookie with an intially requested URL
that could be used later. I found the code to do it. For the code on
the login.html page I would like to tweak it to NOT be server specific.
Here is the code for the front end:

<SCRIPT LANGUAGE=JavaSc ript>
if(document.U RL != "https://test2k301/pkmslogin.form" ){
document.cook ie = ('Referrer_Page ='+document.URL )+'; path=/';
}
</SCRIPT>

Anybody know of a way I can make this work with JUST the path? Put in
other words...I'd like for it to check this to look for ONLY
"/pkmslogin.form" . However, I still want the cookie to always contain the
full URL. This would effectively make it so I didn't have to change the
code to be server specific for each server this gets copied to.
if (document.URL.i ndexOf('/pkmslogin.form' ) != -1)

Hmmm...somewher e along the lines this is breaking the functionality and
causing the cookie to get set when /pkmslogin.form is the path...which is
the why the if check is in place...
Change the != to ==

if (document.URL.i ndexOf('/pkmslogin.form' ) == -1)

If the indexOf is -1 then the string is not present.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 17 '07 #4
DGS

"Randy Webb" <Hi************ @aol.comwrote in message
news:Mo******** ************@gi ganews.com...
DGS said the following on 5/17/2007 2:08 PM:
>"Randy Webb" <Hi************ @aol.comwrote in message
news:u6******* *************@g iganews.com...
>>DGS said the following on 5/17/2007 12:50 PM:
Hi all...

Yesterday I asked about setting a cookie with an intially requested URL
that could be used later. I found the code to do it. For the code on
the login.html page I would like to tweak it to NOT be server specific.
Here is the code for the front end:

<SCRIPT LANGUAGE=JavaSc ript>
if(document. URL != "https://test2k301/pkmslogin.form" ){
document.coo kie = ('Referrer_Page ='+document.URL )+'; path=/';
}
</SCRIPT>

Anybody know of a way I can make this work with JUST the path? Put in
other words...I'd like for it to check this to look for ONLY
"/pkmslogin.form" . However, I still want the cookie to always contain
the full URL. This would effectively make it so I didn't have to
change the code to be server specific for each server this gets copied
to.
if (document.URL.i ndexOf('/pkmslogin.form' ) != -1)

Hmmm...somewhe re along the lines this is breaking the functionality and
causing the cookie to get set when /pkmslogin.form is the path...which is
the why the if check is in place...

Change the != to ==

if (document.URL.i ndexOf('/pkmslogin.form' ) == -1)

If the indexOf is -1 then the string is not present.
That did the trick! Thanks very much Randy!
May 17 '07 #5

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

Similar topics

3
13531
by: Me Mine | last post by:
i, I have trying to code a small console app that will allow a user to select a window and then create a screen capture of the window. I haven't been able to figure out how to do the screen capture part. The code is as follows, the commented out lines at the end are things I have tried, but don't work. Whenever I try to create a compatibe Bitmap or DC it comes back with an error as win32ui: CreateCompatibleDC failed
2
3407
by: Kim Petersen | last post by:
Memory leak - malloc/free implementation - GC kicking in late - know bug - or ? Using python-2.2.2-26 on RH9 (shrike) x86 -fully patched The following program slowly eats up more and more memory when run on large datasets... can anyone tell what the trouble is? i've run it up to 240000 recsets so far - and it eats about .1% of my mem pr. 1000 (doesn't really matter how much does it?).
4
2618
by: Beeman | last post by:
I am looking for a good control that would display/print JPEG images in Access 97. The existing Image controls, even with the JPEG filters, are very slow - and I know there are better ones out there (preferably freeware). TIA... - Blaine ========================================
3
4324
by: Juan Crespo | last post by:
Dear Sirs: My name is Juan Crespo and I write you from Spain, I work as application developer in Industrial Automation in Spain. We have as customer a company that wants to reuse old computers for certain vision applications. The computers have a ASUS AGP-V385GX2 video capture card. I develop my applications in National Instruments LabWindows/CVI (C language Development Environment used in engineering applications) So I am searching...
2
5983
by: Jose | last post by:
There's something for me to learn with this example, i'm sure :) Given this text: "....." and my first attempt at capture the groups: "(?:\)" RegExTest gives me what i expect: 6 captured groups: Contact, Region, All ContractRegion, ASIA PACIFIC, Japan, Japan. However, with this C# code, i just get 2 capture groups: ",
5
3134
by: ewillyb | last post by:
Hi, ASP.NET has some interesting behavior when the user hits the Enter key. If there are multiple ASP:Buttons (rendered as HTML submits) on the form, when the user hits enter, the first button's click event will fire and the page will submit. I have a series of pages with Previous and Next navigational Btns. The Previous button is the first button, so when the user hits enter, the previous page is served up. Enter should result in...
3
1887
by: JeffDotNet | last post by:
I wrote a small data processing application that writes a summary of several hundred files. I use drag and drop on a panel (Panel1) to grab the absolute path to each of these files. Then I begin analyzing all of the files. I noticed (on the same machine) that some user profiles appear to abbreviate the absolute paths to these files thus breaking my data loading mechanism. Does anyone know how I can programmatically change this filepath...
3
17126
by: amanjsingh | last post by:
Hi, I am trying to implement Java Web Service using Apache Axis2 and Eclipse as a tool. I have created the basic code and deployed the service using various eclipse plugin but when I try to invoke the service using client stub, I get this error... Exception in thread "main" java.lang.Error: Unresolved compilation problems: org.apache cannot be resolved to a type org.apache cannot be resolved to a type org.apache cannot be resolved to a...
7
2569
by: Lew | last post by:
Hi, I'm looking for a tool that can capture all the sql transactions for a period of time (24 hours or so ) from our production server and replay it exactly as entered on our performance tuning server. Does anyone know of such a tool from IBM or another vendor? Thanks. Lew
0
9405
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
10169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9960
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
8838
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...
1
7383
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6655
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
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...
1
3930
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3533
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.