PDA

View Full Version : web help needed....


Tom (aka Godzilla)
08-12-2004, 11:22 AM
If someone clicks on a link on my site, I want to display a warning page that says I'm not responsible for content, click yes to continue or no to return.

Anyone know how to do this?

TIA

audiracer2002
08-12-2004, 11:31 AM
somebody could probably write you a little something in javascript that would pass in the link you were trying to go to but always take you to a warning page first, or, you could just do something like:

www.whatever.com (external link*)

and have the * referenced at the bottom of your page with the disclaimer. if they don't read it, thats not your fault.

Tom (aka Godzilla)
08-12-2004, 11:56 AM
Found a way to do it using HTML (i don't know java). Thanks for the help anyway.

here's the code I used:

<a href=blah onClick="alert('Dude!!!')" >

ncttrnl
08-12-2004, 12:19 PM
Found a way to do it using HTML (i don't know java). Thanks for the help anyway.

here's the code I used:

<a href=blah onClick="alert('Dude!!!')" >

Yup this is the correct way to do it.

paultakeda
08-12-2004, 12:21 PM
And it's also Javascript (which isn't Java).

Tom (aka Godzilla)
08-12-2004, 12:42 PM
sorry for my faux pas......the self lashing will begin immediately.

And I don't know javascript either.

Damon
08-12-2004, 12:53 PM
http://sislands.com/coin70/week1/dialogbox.htm

Do the confirm dialog box at the bottom. Change the code to be like this:
<SCRIPT LANGUAGE="JavaScript">

function respConfirm () {
var response = window.confirm('My site contains alot of porn. Continue?');

if (response) window.location='http://www.mypornsite.com';
else window.location='http://www.socaleuro.com';
}

</SCRIPT>
Note: I'm not a javascript dude, just a programmer dude. The syntax may be wrong, but the semantics are there.
:tup: :hammerh:

ncttrnl
08-12-2004, 02:07 PM
Yeah... thats true... if you just put an alert in, after they click okay... they go in.

You would need to use a confirm instead and check their response. You would use the same onClick event to call it but your href would be a "#" you could also just call it from the href as "javascript:foo()"

ncttrnl
08-12-2004, 02:19 PM
<a href="http://www.google.com" onClick="return confirm('Are you sure you want to Google?');">Google</a>

paultakeda
08-12-2004, 02:57 PM
sorry for my faux pas......the self lashing will begin immediately.

And I don't know javascript either.


No faux pas, I meant to say you did indeed use Javascript. You used it right here:

onClick="alert('Dude!!!')


It's not PHP, but it renders quite handsomely. Hey, Tony, how about it just be called "Code:"? :D

aixagent
08-13-2004, 01:38 AM
No faux pas, I meant to say you did indeed use Javascript. You used it right here:

onClick="alert('Dude!!!')


It's not PHP, but it renders quite handsomely. Hey, Tony, how about it just be called "Code:"? :D

Try something like this:



<!-- automatically popup the box at the load of the page -->

<body onLoad="return confirmClick();">

<script language = "JavaScript" type="text/javascript">

<!-- function for confirming stuff -->

function confirmClick()
{
var confirmation = confirm("I'm not responsible for this stuff. Do you agree?");

if(confirmation)
{
<!-- if the user picked yes then do this... -->
window.location = "http://www.pooponmyface.com";
}
else
{
<!-- if the user didn't pick yes then do this... -->
window.location = "http://www.disney.com";
}
}
</script>


ez as cake. enjoy.

aixagent
08-13-2004, 01:42 AM
Try something like this:



<!-- automatically popup the box at the load of the page -->

<body onLoad="return confirmClick();">

<script language = "JavaScript" type="text/javascript">

<!-- function for confirming stuff -->

function confirmClick()
{
var confirmation = confirm("I'm not responsible for this stuff. Do you agree?");

if(confirmation)
{
<!-- if the user picked yes then do this... -->
window.location = "http://www.pooponmyface.com";
}
else
{
<!-- if the user didn't pick yes then do this... -->
window.location = "http://www.disney.com";
}
}
</script>


ez as cake. enjoy.

oh just noticed you wanted it for a link... do this:


<script language="javascript" type="text/javascript">
function confirmLink()
{
var conf = confirm("i'm not responsibel blah");
if(conf)
{
return true;
}
else
{
return false;
}

return false;
}
</script>

<a href="http://www.thelink.com" onClick="return confirmLink();" target="_blank">test link</a>

madajb
08-13-2004, 01:53 AM
Or you could use something like:

<blink>Hey, this page has "Riots in the streets, dogs and cats living together, mass hysteria!"</blink>
Click here <a href="http://myporn.myserver.mycom/pr0n.html">

No cool clicky javascript, but hey, it works. =)
-ajb

madajb
08-13-2004, 01:54 AM
Hey, Tony, how about it just be called "Code:"? :D
The tag you are looking for is {CODE}.
=)
10 Print "Hello World"
20 Goto 10

-ajb

aixagent
08-13-2004, 01:59 AM
The tag you are looking for is {CODE}.
=)
10 Print "Hello World"
20 Goto 10

-ajb

10 Print "Hello to you too Alan."
20 Goto 10

creanium
08-13-2004, 02:29 AM
y'all need to get out more

ncttrnl
08-13-2004, 08:08 AM
oh just noticed you wanted it for a link... do this:


<script language="javascript" type="text/javascript">
function confirmLink()
{
var conf = confirm("i'm not responsibel blah");
if(conf)
{
return true;
}
else
{
return false;
}

return false;
}
</script>

<a href="http://www.thelink.com" onClick="return confirmLink();" target="_blank">test link</a>



This is the same as what I said but mine took only one line :rolleyes:

aixagent
08-13-2004, 11:02 AM
This is the same as what I said but mine took only one line :rolleyes:

you're using an alert which lacks the mega-cool ok or cancel feature ;)

ncttrnl
08-13-2004, 11:50 AM
you're using an alert which lacks the mega-cool ok or cancel feature ;)

<a href="http://www.google.com" onClick="return confirm('Are you sure you want to Google?');">Google</a>

No I'm not

aixagent
08-13-2004, 02:02 PM
No I'm not

oh ok whatever fine =]

paultakeda
08-13-2004, 02:15 PM
Code is boring... it has no color.


if (this.thread.isDead)
{
return;
}
else
{
this.thread.posts.Add(new Post(user.id, "", "Go suck an egg."));
}



if ($thread->isDead)
{
return;
}
else
{
array_push($thread->posts, new Post($user->id, "", "Go suck an egg."));
}

paultakeda
08-13-2004, 02:37 PM
If you want to have a custom window prompt, then do the following, and simply tweak the stylesheet.


<style type="text/css">
#prompt
{
position: absolute;
z-index: 255;
}

div.box
{
border: 1px solid #000000;
background-color: #dcdcdc;
}

div.box h1
{
font-size: 12px;
font-weight: bold;
text-align: center;
padding-top: 10px;
}

div.box h2
{
font-size: 12px;
font-weight: bold;
text-align: center;
}
</style>
<script language="javascript">
function togglePrompt()
{
var prompt = document.getElementById("prompt");
var h = (document.body.clientHeight/2) - (parseInt(prompt.style.height)/2);
var w = (document.body.clientWidth/2) - (parseInt(prompt.style.width)/2);
prompt.style.top = h + "px";
prompt.style.left = w + "px";
prompt.style.display = prompt.style.display == "none" ? "block" : "none";
}
</script>
<a href="#" onclick="togglePrompt();">Google</a>
<div id="prompt" style="display: none; top: 0px; left: 0px; width: 200px; height: 80px;">
<div class="box">
<h1><span>Are you sure you want to Google?</span></h1>
<h2><a href="http://www.google.com/search?&q=socaleuro"><span>Yes</span></a>   <a href="#" onclick="togglePrompt();"><span>No</span></a></h2>
</div>
</div>