1

I am using this code:

set javaScriptVar to "var body = document.body, html = document.documentElement; var height = Math.max(body.scrollHeight, body.offsetHeight, html.scrollHeight, html.offsetHeight); return height"

set myJSvar to do JavaScript javaScriptVar in document 1

display alert myJSvar

And the value I am getting is: msng
What's wrong with this?

1 Answer 1

1

Try:

set javaScriptVar to "var body = document.body; html = document.documentElement; var height = Math.max(body.scrollHeight, body.offsetHeight, html.scrollHeight, html.offsetHeight); height;"

tell application "Safari" to set myJSvar to do JavaScript javaScriptVar in document 1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.