Prepare js for search query