post method and javascript in index