How to execute this "Hello Word" Javascript

veeco

Client
Регистрация
27.05.2011
Сообщения
112
Благодарностей
1
Баллы
18
Hello Guys,
I've been "Playing" with ZP for 5 days.. i'm not fluent enough right now as i found obstacle and 'limitation' while learning it.

Currently i try to work Javascript with zennoposter..

I tried to write something to browser: document.write("hello world") ;
macro: {-JS.Execute-|-document.write("Hello World!");-}

i put in on macro "execute javascript"... but i doesn't work as expected
any idea ?


Edit:
i also tried to use :document.body.innerHTML = "hello world";
macro: {-JS.Execute-|-document.body.innerHTML = "hello world";-}

Still no luck....
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
You can't use the document.write command because you are not on a webpage. In other words, the browser would read the document.write command and output "hello world" to the webpage. The javascript function in ZP is only for carrying out JS object commands not for Browser or document commands.

If you would put {-JS.Execute-|-("hello world") ;-} into a Step Branch and execute it, the result would be hello world in the Step Branch result, but you would not get hello world to show up in the instance. You can't create a webpage in the instance with Javascript as far as I have seen (and tried)
 

Tropicalista

Client
Регистрация
24.05.2011
Сообщения
29
Благодарностей
0
Баллы
0
you could try with javascript: document.body.innerHTML = "hello world" + document.body.innerHTML; void 0;

I have similar problem, support told me that probably they will imlement dom access via javascript in next release.
 

veeco

Client
Регистрация
27.05.2011
Сообщения
112
Благодарностей
1
Баллы
18
any idea on how to write to browser ? in ubot there's a command node "write to browser"... i'm looking for similiar function...
 

gemini

Client
Регистрация
10.03.2011
Сообщения
160
Благодарностей
31
Баллы
28
use branch builder -> "set" and you can set innerhtml to an object.
 

veeco

Client
Регистрация
27.05.2011
Сообщения
112
Благодарностей
1
Баллы
18
ok great.. i can modify the content of the page now... but having ZP's ability to modify through DOM object will make some process real quick...
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)