Javascript String Contains

Stroks

Client
Регистрация
09.02.2012
Сообщения
219
Благодарностей
14
Баллы
18
I know i can do this another way, but i want to learn a bit about javascript so I can make templates faster.

I want to check in javascript if a string containts word "Article".

Код:
var mystring = {-Variable.PostURL-};
var contains = (mystring.indexOf('Article') > -1);
I tested and it doesn't work. The example is in the attachment. Could you help to fix it?

Also what is put into the variable associated with javascript? Maybe the var contains?


Посмотреть вложение test1.xmlz
 

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