Javascript Alert (Poll and Tutorial)

Post anything on anything here

Moderator: Moderators

Did this HTML work for you?

Yes!
2
50%
The First One Did
0
No votes
The Second One Did
0
No votes
None of them worked (get a new internet browser :P)
2
50%
 
Total votes : 4

Javascript Alert (Poll and Tutorial)

Postby InfinityHOVRL » Sun Dec 07, 2008 11:02 am

If you have a website and no cms (content management system), and you don't want one anyway, also needing an alert box, read on.

To do your basic alert (popup) type this (if doing with html)

Code: Select all
<script type="text/javascript">
javascript.alert("Oh My God You Can Edit This Text!")
</script>


After the first " you can edit and put your own text.

To do a question popup asking for a name to later add to a php script type:

Code: Select all
<html>
<head>
<script type="text/javascript">
function disp_prompt()
{
var name=prompt("Please enter your name","Willy Nilly");
if (name!=null && name!="")
  {
  document.write("Hello " + name + "! How are you today?");
  }
}
</script>
</head>
<body>



I might of made an error there, just post back and tell me what i did ;)

Anyway good luckz wit da l33t codez

P.S: 3rd Post !
=) - This is stig. Copy Stig into your signature and help him on his way to world domination.

- InfinityHOVRL - 1337
InfinityHOVRL
Newbie
 
Posts: 4
Joined: Sun Dec 07, 2008 10:26 am

Postby divVerent » Sun Dec 07, 2008 11:51 am

NoScript extension rules. Helps getting rid of such annoyances.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Thanks

Postby InfinityHOVRL » Sun Dec 07, 2008 12:09 pm

Ok, i will remember that for next time :wink:
=) - This is stig. Copy Stig into your signature and help him on his way to world domination.

- InfinityHOVRL - 1337
InfinityHOVRL
Newbie
 
Posts: 4
Joined: Sun Dec 07, 2008 10:26 am

Postby GreEn`mArine » Sun Dec 07, 2008 3:40 pm

Hopefully you won't start asking questions about hmm .. ventilation shafts (random() idea) next time. That would fit in here as well as your question :D

Seriously. Please find the appropriate forums for such a technical question next time.
IRC quote:
[kojn] I've been coming a bit more recently
[kojn] she took it the dirty way
GreEn`mArine
Forum addon
 
Posts: 1509
Joined: Tue Feb 28, 2006 9:33 pm
Location: Germany

Postby The mysterious Mr. 4m » Sun Dec 07, 2008 5:07 pm

"Edit Site Preferences..." -> "Scripting" -> "Allow JavaScript" -> "NEY!!!!"
4m [PB] (amoebios)

This is Your world.
The mysterious Mr. 4m
Forum addon
 
Posts: 1402
Joined: Wed Mar 01, 2006 6:03 pm
Location: germany

Postby divVerent » Sun Dec 07, 2008 5:51 pm

Yes, I now am using Opera too, and have "Edit site preferences" bound to ctrl-s :P that's a poor man's NoScript.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Psychcf » Sun Dec 07, 2008 8:09 pm

why not just make a greasemonkey script that does this...

Code: Select all
delete alert;


problem solved.
Psychcf
Forum addon
 
Posts: 1554
Joined: Sun Dec 03, 2006 11:38 pm
Location: NY, USA

Postby divVerent » Sun Dec 07, 2008 8:11 pm

because document.write is used for evil too, and about anything else possible in javascript.

Yes, thank you, doubleclick and other ad companies, you made javascript a nuisance.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron