lala138
05-05-2004, 12:31 AM
I am a new user for learning Javascript, i have the problem when i do my exercise. Question :
Suppose that count is a JavaScript variable and that its value is the number of people who have accessed the current web page. Write a single line of JavaScript code that uses a JavaScript alert to say:
The number of people who have already visited this page is X
where X is whatever value count currently has. Thus if the value of count is 4152, the alert would say
The number of people who have already visited this page is 4152
My code :
<!-- hide script from old browsers
var count;
count=4152;
alert("The number of people who have already visited this page is " + count);
//-->
The result is :
Logic or Runtime Errors
Our Analysis Of Your Code:
Do not change the count variable.
It stoped me to do the next exercise, please hple me to make the correction of my code. Thanks a lot.
Suppose that count is a JavaScript variable and that its value is the number of people who have accessed the current web page. Write a single line of JavaScript code that uses a JavaScript alert to say:
The number of people who have already visited this page is X
where X is whatever value count currently has. Thus if the value of count is 4152, the alert would say
The number of people who have already visited this page is 4152
My code :
<!-- hide script from old browsers
var count;
count=4152;
alert("The number of people who have already visited this page is " + count);
//-->
The result is :
Logic or Runtime Errors
Our Analysis Of Your Code:
Do not change the count variable.
It stoped me to do the next exercise, please hple me to make the correction of my code. Thanks a lot.