Is it a bug? help me please!

kingkong

Новичок
Регистрация
17.06.2015
Сообщения
6
Благодарностей
0
Баллы
1
Javascrip code:

var input_id;
var patt=new RegExp(/(?<=id=")[\w\W]*?(?=")/);
input_id = patt.exec('<input id="input_1" value="">');

I cannt get the input id when I running on current page, but i can get it running local.

is this a zennoposter bug?
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 251
Благодарностей
5 848
Баллы
113
When executing Javascript code locally, it works not depending on browser and environment. In this case it's better process data using JS.
When executing Javascript code on current page, it works with DOM-objects on web-page loaded in browser. You should use it to operate with web-elements on page.
 

kingkong

Новичок
Регистрация
17.06.2015
Сообщения
6
Благодарностей
0
Баллы
1
in this case, that's a test string. in my project, i need get some html source and find the id, and do something. so, i need executing code on current page.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 251
Благодарностей
5 848
Баллы
113
In the Elements tree window you can find opjects on current web-page and process them in your script.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113

kingkong

Новичок
Регистрация
17.06.2015
Сообщения
6
Благодарностей
0
Баллы
1
thanks for your helps, I solved it by other ways, but I still think that's a bug.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
I do not suggest to use JavaSctipt action unless there are no any alternatives. Gecko has problems with JS memory leaks.
 

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