working on php javascript friendliness