External JavaScript

External JavaScript

cimescimes Posts: 3Questions: 0Answers: 0
edited April 2012 in General
I transfer through ajax dynamicly value(javascript) of a line


$row[] = '

var timerId = '.$aRow[0].';
var TargetDate['.$aRow[0].'] = "'.$last_time.'";
var NowDate['.$aRow[0].'] = "'.$now_time.'";
var CountActive['.$aRow[0].'] = true;
var CountStepper['.$aRow[0].'] = -1;
var LeadingZero['.$aRow[0].'] = true;
var DisplayFormat['.$aRow[0].'] = "%%H%%:%%M%%:%%S%%";
var FinishMessage['.$aRow[0].'] = "Акция завершена!";
startIt(timerId);



';

respectively it doesn't work (startIt(timerId);)!
What it is necessary to make?

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    I think in general your code is not a good practice. Some evil person could hijack your AJAX, and run code on the client's browser.

    I would just make a Javascript function, and let AJAX only give the variables to make the function work.
This discussion has been closed.