implements query by java script