We help IT Professionals succeed at work.

javascript returns 'undefined'

Mr_Shaw
Mr_Shaw asked
on
Medium Priority
409 Views
Last Modified: 2012-05-07
I have the following script which I want to capture the curret scroll position and write it to the screen. But instead of writing a figure it is writing the word 'undefined'

here is my script.

<script language=javascript>
var test = window.pageYOffset;
document.write(test);
</script>


Comment
Watch Question

Application Support Analyst
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Kamaraj SubramanianApplication Support Analyst
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Shahzad Fateh AliHead Of Engineering - Dawaai.pk
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.