1

我正在使用这段代码:

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

我得到的价值是:msng
这有什么问题?

4

1 回答 1

1

尝试:

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
于 2013-08-29T17:58:09.823 回答