Works now using jQuery $.ajax