Click to See Complete Forum and Search --> : My Computer Has Feelings Too!


tomyknoker
06-25-2003, 04:31 AM
hi,
I want to create a HTML page with JavaScript that upon loading, the page asks the computer how it feels and displays onto the HTML page the computers response,
thanks again,
tom

Padrill
06-25-2003, 04:44 AM
Try this:

<html>
<head>
<title>You know I've got feelings too</title>
<script language="Javascript">
var today = new Date();

function displayFeelings(day) {
var todaysFeelings = new FeelingClass(day);

var f = todaysFeelings.getFeeling;

alert('Your computer today is feeling: ' + f);
}

</script>
</head>
<body onLoad="displayFeelings(today)">
</body>
</html>

Please note: If your computer responds anything like 'Your computer today is feeling: Undefined' it's holding grudges against you. If it denies to compile the program then it needs intensive therapy.

tomyknoker
06-25-2003, 05:06 AM
hi tried this code but when it runs nothing displays?

Padrill
06-25-2003, 05:23 AM
I think you need to update your feelings card drivers to the latest ones. Go to the manufacturer's web site and get the newest version.

tomyknoker
06-25-2003, 05:28 AM
oh I see your having fun with me! well I am just a newbie to JavaScript and wanted to see if this could be done...

petermar30030
06-26-2003, 11:54 AM
You Know You Could Just Use A New Array With The Feelings Happy,sad,Surprised, and Mad, Then You Could Use The math.random() function so that A Random Feeling Will Be Displayed In A Alert Box.
Hope I Helped...