/    Sign up×
Community /Pin to ProfileBookmark

decisions, decisions

I have a joke site and on the first page there is confirm box, and when OK is clicked it takes you to an uncensored jokes page and when cancel is clicked it takes you to a clean jokes page.
However many of the pages in each section of the site are either the same of very similar, but I’ve had to have 2 copies of them all in separate folders.
So is there any SIMPLE way to, after the original choice of site, go to the same page but have different content on it depending on the users choice, also they must be able to navigate around the site and stiil have the appropriate content, also there must be a link or button (preferably a link) that when pressed can change their decision.

to post a comment
JavaScript

14 Comments(s)

Copy linkTweet thisAlerts:
@khakiApr 06.2003 — Hi lavalamp...

i checked-out your source code and you had some problems that caused your code to not function.

Try this (i think that this is what you are after).

(i hope that this is not a very offensive site, lavalamp. i would not be happy lending assistance to anything that spreads hate and disrespect)

? k

<script language="javascript">

var agree=window.confirm("Do you want to see some proper PREJUDICED AGAINST EVERYONE jokes? If so click OK. If however you are a faint hearted wimp who can only stand squeeky clean jokes click cancel!!!");

if (agree)

document.location.href="Dirty_Jokes/Main_Page.html";

else

document.location.href="Clean_Jokes/Main_Page.html";

</script>
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 06.2003 — erm, I've got three things so:

1) The site is meant to be taken lightly and I've taked care not to be racist.

2) Why wasn't my script working before? Whenever I've tried it at school or at home it has always worked.

3) Unfortunately, I only want one main page because most of the page is the same and depending on the decision that the user makes I want to change the content accordingly.

Hey dave what code should I use for the non-cookie version because I've only just started just before 2003 so I've never done anything like that.
Copy linkTweet thisAlerts:
@khakiApr 06.2003 — 1) good

2) i have no idea. it did not redirect me when i clicked on your link. i thought that was the problem/question.

(do you mean to say that it works for you [I]as-is[/I]? not for me ? )

3) the setup you have now is probably the simplest for you to manage (1 main page that redirects to one of 2 pages). but you can do this many different ways. it's up to you (and how much you are willing to learn/apply).

as to your last item... i'll go ahead and let dave answer you since he already has that logic figured-out.

good luck

? k
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 06.2003 — A couple of point's first of all what browser to you use because i've only ever tried it with internet explorer? Also what do you mean by as-is?
Copy linkTweet thisAlerts:
@khakiApr 06.2003 — I am currently viewing via Netscape7.

I also have a buggy and unreliable IE5.0 which tends to throw errors for no good reason.

By [B]as-is[/B] I mean as your page is currently coded (when clicking on your link in your signature).

The page did not redirect and the code which I provided enabled it to do so (in my tests).

(you is wearin' me out! ? )

but that's okay...

you set for a while yet... or do you have more :eek: ?

? k
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 07.2003 — I think this might be exactly what I'm looking for but can you do me a favour and upload a zipped file of all of the pages and any .js files that go with it because there seem to quite a few pages and depending on what is entered in the boxes they always change.
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 08.2003 — Thankyou for helping me with my code problem, I'm going to put it on my site soon but can you please explain to me what each line of code does because I look at it and I just don't get it.

For instance whenever I have written any kind of function I have never had anything in hte brackets, so what does that do etc.

And just what is a hash array, and what does var mean anyway?
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 10.2003 — Ok, I had a look in that online reference guide but it just isn't written for people like me so could you just explain why this line works:

var ary = inpt.replace(/+/g, " ").split("&");

I know that it replaces + signs with spaces, (if it doesn't please tell me), but what's th g for and what are there so many slashes in there.
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 11.2003 — Ok, I'm slowly but surely figuring out your source by deleting various bits and seeing what happens but...

What goes onto the end of the address name depends on what the user enters in a form by using method="get" however no matter how I try I cannot figure out how to tack what I want onto the end of the address depending on a choice that the user makes with a confirm box. Can you please clue me in on how to do this, hopefully this will be my last question on this thread.
Copy linkTweet thisAlerts:
@khakiApr 11.2003 — [I][B]Dave wrote: [/B]How gracious! ?[/I][/QUOTE]yes... [I]very[/I] gracious! ?

[B]how [I]you[/I] doin'?[/B]

(it's a jersey thing) ?

? k
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 12.2003 — What you had just written was so similar to what I wanted that even I could modify it to give what I wanted. Thank-you very much.

I took one of the funtions and put it into my date.js file (the one .js file on my site that contains almost all of the js) and it worked, I can get it to do what I want, however, whenever the page loads it always says done, but with errors on page and I think it's the script, I was wondering if would could maybe skim through it quickly to see if there are any glaring errors, don't feel you have to because it will be pretty boring and my script is messy.

I realise I'm asking a lot and I'm sorry but maybe one day I'll be able to help people who are in the same position that I'm in now.
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 12.2003 — ? Oops, I forgot to upload the script.

[upl-file uuid=a7dc2872-bc98-41a2-9e2b-c8101c0e1fa9 size=2kB]date.zip[/upl-file]
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 12.2003 — the add. in my signature + /date.js

and what do you mean by the local-setup thing?

Just download winzip.
Copy linkTweet thisAlerts:
@David_HarrisonauthorApr 13.2003 — I think I found what was causing the error, on the test page I didn't specify what the pagenumber was so at the bottom of the script when it needed, it and didn't have it, so there was an error, but if you were to spot any other errors that need fixing please tell me.

I just downloaded Netscape 7.02 so I haven't had chance to check the script thoroughly to see if it works on it yet.

By the way, there are some clean jokes on my site as well, even if the're not very good.
×

Success!

Help @David_Harrison spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...