Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-24-2004, 06:15 PM   PM User | #1
J.L. Orozco
New to the CF scene

 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
J.L. Orozco is an unknown quantity at this point
Question Borrowed Script w/ Flaw...noticed when 'Back'-ing Into OR Refreshing the Page.

Code was copied from JavaScript Kit:

http://www.javascriptkit.com/script/...plecombo.shtml

*Note - Attached: Script in a text file (*.txt extension)

Using the script for the first time works perfect.



Once the code is used (directed to a link on the 3rd stage)..and you 'Back Button' into the
page this is displayed [below]...Stage2 and Stage3 are useless..The only way to get the useful
links back is to Select something different in Stage1 to reset everything.



I don't know what's causing this. Refreshing the page doesn't help. It seems the only way
to correct the problem is select something else on Stage 1.

I hope someone can shed some light on this. Please and Thank You.

PS: I'm new to Javascript. All I did was take this code and add array entries.

That's all I know about this script.
Attached Files
File Type: txt javascript.txt (3.8 KB, 135 views)
J.L. Orozco is offline   Reply With Quote
Old 06-25-2004, 01:59 AM   PM User | #2
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
The first thing you can fixed is returning the credits you removed, but agreed not to when you got the script from Javascript Kit.

Post back with an updated script and I will be glad to take another look.

Quote:
/*
Triple Combo Script Credit
By Hamid Cheheltani/ JavaScript Kit (http://www.javascriptkit.com)
Visit http://javascriptkit.com for this and over 400+ other scripts
*/
.....Willy
Willy Duitt is offline   Reply With Quote
Old 06-25-2004, 03:45 AM   PM User | #3
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
And it's not the script's flaw. You need a way to save the selected item in a "session-based persistent client-side" storage such as window.name property or session cookie and then on the page onload handler, you have to retrieve them and set them as selected.
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 06-25-2004, 01:44 PM   PM User | #4
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
I got your PM and as Glenn suggested, you will need to store the selected item either on the window.name property or a cookie. This exact question has been recently answered. Try searching this forum and/or the Dynamic Drive Scripts Help forum for the already posted solution.
Willy Duitt is offline   Reply With Quote
Old 06-29-2004, 02:31 AM   PM User | #5
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Here's the solution using the "window.name" technique. You can use this if the page this is in is not in a frame or iframe.

I put back the credits to the page, please don't remove it.


off-topic
Woo hoo! This is my "formal" 5,000th post!
Attached Files
File Type: txt 3combo.htm.txt (4.7 KB, 119 views)
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app

Last edited by glenngv; 06-29-2004 at 03:17 AM..
glenngv is offline   Reply With Quote
Old 06-30-2004, 11:36 AM   PM User | #6
J.L. Orozco
New to the CF scene

 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
J.L. Orozco is an unknown quantity at this point
Lightbulb How do I do thaat - OPEN a NEW WINDOW

How would I open a new window to view the target?
J.L. Orozco is offline   Reply With Quote
Old 06-30-2004, 11:48 AM   PM User | #7
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
If you want all items to be opened in a new window regardless of the file type:
Code:
function redirect2(z){
   window.open(temp1[z].value, "_blank");
}
If you want only pdfs to be opened in a new window:
Code:
function redirect2(z){
    if (temp1[z].value.toLowerCase().lastIndexOf('.pdf')!=-1) {
        window.open(temp1[z].value, "_blank");
    }
   else {
        window.location=temp1[z].value;
   }
}
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:33 AM.


Advertisement
Log in to turn off these ads.