How to execute this "Hello Word" Javascript

  • Автор темы Автор темы veeco
  • Дата начала Дата начала

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....
 
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)
 
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.
 
any idea on how to write to browser ? in ubot there's a command node "write to browser"... i'm looking for similiar function...
 
use branch builder -> "set" and you can set innerhtml to an object.
 
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)