473,218 Members | 1,809 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,218 software developers and data experts.

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=JavaScript>
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 2447
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=JavaScript>
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.indexOf('/pkmslogin.form') != -1)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript 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********************@giganews.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=JavaScript>
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.indexOf('/pkmslogin.form') != -1)
Hmmm...somewhere 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********************@giganews.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=JavaScript>
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.indexOf('/pkmslogin.form') != -1)

Hmmm...somewhere 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.indexOf('/pkmslogin.form') == -1)

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

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript 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********************@giganews.com...
DGS said the following on 5/17/2007 2:08 PM:
>"Randy Webb" <Hi************@aol.comwrote in message
news:u6********************@giganews.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=JavaScript>
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.indexOf('/pkmslogin.form') != -1)

Hmmm...somewhere 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.indexOf('/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
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...
2
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...
4
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...
3
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...
2
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...
5
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...
3
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...
3
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...
7
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.