Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-17-2007, 11:28 PM
Chrispy is offline Chrispy

Join Date: Sep 2005
Location: Peria, New Zealand
Posts: 6,770

Send a message via MSN to Chrispy Send a message via Yahoo to Chrispy
Is there a script to do this?

You know those games on the net where it says something like:

"Do not click this button"

...

Then you click the button...

Then it says:

"No, do not click this button."

...

Then you click it, and another message pops up, etc. Is there a script that does this?

I was thinking I use a script on a page that does that and you can type in the text strings for it.

Does it require the use of JavaScript?

Thanks guys.

Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black
Reply With Quote
  #2  
Old 11-17-2007, 11:46 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
its javascript

alert.show("Do not click this button");
alert.show("I told you not to click that button");
Reply With Quote
  #3  
Old 11-18-2007, 12:48 PM
Chrispy is offline Chrispy

Join Date: Sep 2005
Location: Peria, New Zealand
Posts: 6,770

Send a message via MSN to Chrispy Send a message via Yahoo to Chrispy
Oh okay. So I put this in e.g: a file called "script.js" - but how would I execute it in my HTML/XHTML document?

I'll try Googling if I get no answer (once I get back home from school).

Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black
Reply With Quote
  #4  
Old 11-18-2007, 01:22 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
I think you do a thing like:
<body onload="init()">

then put the alerts in a funtion

for example this function would be
function init()
{
alert.show("Do not click this button");
alert.show("I told you not to click that button");
}
__________________
Reply With Quote
  #5  
Old 11-18-2007, 02:17 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
all you have todo is either


<script type=javascript>
alert.show("blah");
</script>



or just (if wanting to use a js file)

<script src="annoy.js">
</script>

in your html

It will automatically execute the javascrip in the scripts when the page loads.


IcI
Reply With Quote
  #6  
Old 11-18-2007, 06:29 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
fine ici, make me feel like an idiot. Thanks!
__________________
Reply With Quote
  #7  
Old 11-18-2007, 06:56 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
lol - you way would work but you would still have to do one of the 2 ways I posted, and the function would have to be declared in the header, otherwise <body onint="int()"> won't know what function int() is ie:


Code:
<html>
<head>
<script script type="text/javascript">
function annoy()
{
alert.show("Blah");
}
</script>
</head>

<body onint="annoy()">
</body>

And in correction to my first reply - the correct script mark up is

<script type="text/javascript">

</script>
Reply With Quote
  #8  
Old 11-18-2007, 09:17 PM
Chrispy is offline Chrispy

Join Date: Sep 2005
Location: Peria, New Zealand
Posts: 6,770

Send a message via MSN to Chrispy Send a message via Yahoo to Chrispy
It ain't working. I tried every way there was but nothing. Tested in IE6 and FF.

Also, is there some way (when it works), I can set the page up so that there's some normal paragraphed text then the button down bottom that says "Do Not Click"?

Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black
Reply With Quote
  #9  
Old 11-18-2007, 09:23 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
post the code
Reply With Quote
  #10  
Old 11-18-2007, 09:42 PM
Chrispy is offline Chrispy

Join Date: Sep 2005
Location: Peria, New Zealand
Posts: 6,770

Send a message via MSN to Chrispy Send a message via Yahoo to Chrispy
Code:
<script type=javascript>
alert.show("blah");
</script>
I haven't put in the <html>, <head>, etc. tags - dunno if they are needed to work.

Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black
Reply With Quote
  #11  
Old 11-19-2007, 09:07 AM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
yes, it needs to be a properly formed html page - you don't need the <head></head> tags but you do need the rest:


Code:
<html>

<body>

<script type=javascript>
alert.show("blah");
</script>

</body>

</html>
Reply With Quote
  #12  
Old 11-19-2007, 09:58 PM
Chrispy is offline Chrispy

Join Date: Sep 2005
Location: Peria, New Zealand
Posts: 6,770

Send a message via MSN to Chrispy Send a message via Yahoo to Chrispy
Still ain't working in IE/FF.

However, it does say (like last time) that IE has blocked something from running on the page. When I allow it, nothing happens still.

Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black
Reply With Quote
  #13  
Old 11-19-2007, 11:20 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
sounds like the page is being run in restricted mode, which disables javascript. - I run into that alot, but haven't found out how to tell it not to run the page in restricted mode.
Reply With Quote
  #14  
Old 11-19-2007, 11:31 PM
Chrispy is offline Chrispy

Join Date: Sep 2005
Location: Peria, New Zealand
Posts: 6,770

Send a message via MSN to Chrispy Send a message via Yahoo to Chrispy
Quote:
Originally posted by icishoot
sounds like the page is being run in restricted mode, which disables javascript. - I run into that alot, but haven't found out how to tell it not to run the page in restricted mode.
The active scripting setting has been enabled in IE - WTF lol?

Is there some alternative way to do this (this as in, the button clicking game thing), like in HTML somehow?

I was gonna look at the source code at the site that inspired me to do it - but the link to it is down... :/

Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black
Reply With Quote
  #15  
Old 11-20-2007, 12:25 AM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
my bad, didn't have the code right:

Code:
<html>

<body>

<script language="Javascript">

alert ("blah")
</script>

</body>

</html>
Reply With Quote
  #16  
Old 11-20-2007, 01:28 AM
Chrispy is offline Chrispy

Join Date: Sep 2005
Location: Peria, New Zealand
Posts: 6,770

Send a message via MSN to Chrispy Send a message via Yahoo to Chrispy
It worked. Thanks man.

But what I was kinda looking for was more of a button on a page rather than an alert window popping up. And I'm able to add text above the button on the page, etc.

Thanks again mate, anyway.

Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black
Reply With Quote
  #17  
Old 11-20-2007, 01:53 AM
Lakie is offline Lakie

Join Date: Mar 2002
Posts: 5,540

Code:
<script type="text/javascript">
var answer = confirm ("Do you want to continue?")
if (answer)
alert ("You answered Ok!.")
else
alert ("You answered Cancel.")
</script>
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHPBB Script Jeff Web design and Programming 18 09-30-2005 10:42 AM
tutorial script atholon Web design and Programming 16 07-23-2005 10:31 PM
old script Djinn phphq.Net Forums 3 03-25-2005 11:14 AM
mail script PHP-Largo phphq.Net Forums 2 10-19-2004 09:49 PM
My First Script :) EDGE Web design and Programming 13 07-05-2004 02:56 PM


All times are GMT -5. The time now is 09:42 AM.




Powered by vBulletin®