DOM with javascript?

osho

Client
Регистрация
20.03.2012
Сообщения
125
Благодарностей
5
Баллы
18
I wrote this script to extract the form number from DOM. It works in other js debuggers, but I don't know what I'm doing wrong with Zenno.

Код:
var pageSource = '{-Page.Dom-}';

var re = /<form[^>]*>/gim;
var match= {};
var counter = 0;
var formNumber = 0;
  while (match = re.exec(pageSource)) {
       if (match[0].indexOf('id="register"') !=-1) {
    formNumber = counter;
       }
      counter++;
  }

alert(formNumber);
How can I feed javascript the Page.Dom correctly?
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
I'll check this JS as soon as I login to my machine with Zenno. But I guess you can do that in Zenno as well with a loop and action designer by changing match number with counter.
 

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