Made standard resistor php file load JS script with realpath(dirname(__FILE__)), which should give the correct path no matter where php file is included from.