the javascript is just to "document.writeln"
I think we can just output this line on php. I have tested it on querywindow