Sunday, June 22, 2008

Actual error message reads:

Hello- you either have JavaScript turned off or an old version of Adobe s Flash Player. Get the latest Flash player.

I have downloaded the latest version of flash player many times- but this hasn t helped. I am using Windows Vista.

Any help is greatly appreciated!!!

3.Complete the following codes to achieve the following:
(i)When the page is loaded- prompt for the user name
(ii)When the phrase click me is clicked- an alert box will be displayed to tell the user how many times he/she has clicked the phrase click me.

<html>
<head>
<title>Simple JavaScript</title>
<script type="text/javascript">
<!â€"your functions here 
</script>
</head>
<body>
<h1>Please <span style="text-decoration:underline; color:red; font-size:+2em" click me</span>!!</h1>
</script>
</body>

teacher havent taught us how to do this yet- but i m learning it on my own so I do have difficulty doing it..please help me..Thanks

This is a program used to ask a user to roll a dice.

<html>
<head>
<script type="text/javascript">

var result;

function rollDice() {
result = Math.floor(Math.random()*7);
alert("You rolled a " + result);
return false;

}

</script>
</head>
<body>
<a href = "#" onclick = "rollDice();">Roll The Dice</a>
</body>
</html>

I don t understand why there is a (Math.random()*7)?
Why is there a return false?
why is there a "#"?
The function with the name rollDice..We can name it another name right- no need rollDice also can?
Why it is rollDice() << the brackets are important?

Sorry sorry I havent learnt this chpt yet so I m confused with all these stuffs and hence asked a lot of stupid questions.. .__-
ohya why is it *7? Other numbers also acceptable?
this is java language though. not c++ or c#

Just wondering- how to make scrolling text using javascript. I meant- eh- the words/texts that keep scrolling at the bottom bar (eg when you visit a blog- you can see words scrolling at the bottom bar- above the start button- there s a little bar where you can see the words scrolling. This can be done using javascript..but I havent learn that before so I dont know how...not marquee..)

Thanks

This is a javascript that I have made myself...This is a problem underlying in the script at the enter age part when I entered 101 years old- (by right- I have set the limit that anything more than age 13- the alert pop-up box will write old... but instead- it showed me so young!!.. when I ran the program..

Please correct my program- and explain on where I had went wrong- thank you :D
<html>
<head>
<title>funfun haha</title>
</head>

<body>
<script type="text/javascript">

var name=prompt("What s your name?");
var answer=confirm("Are you sure?");

if (answer==true) {
alert("Hi "+name+"- nice to meet you");
}
else {
alert("Go die la!!!");
}

var age=prompt("How old leh?");

if (answer<=13){
alert("WA! So young!");
}
else {
alert("old...zz..xD");
alert("WAHAHHAHAHAHA!!");
}
window.close();

</script>
</body>
</html>
Brandon: Yours doesn t work. I can also see blank screen.

I keep trying to fix this but it wont let me get on youtube or any other site that requires adobe flash player- it may have to do with JavaScript but how can I fix it?

No comments: