getting creating posts working with javascript