build the html search body from php to javascript