migration to jquery from php