I am creating a plugin and all functionality seems to work ok. However, in the admin page i am using an ajax call to a php file to save information entered into a form.
Sometimes it saves, other times it doesn't.
-
THE FORM - call example
form onsubmit="functionCall()" id="formSave"
-
AJAX FUNCTION
var url = 'http://localhost/'; var link_id = '1'; $.ajax({ url: url+"/wp-content/plugins/wpCountdown/admin/save.php?link_id="+link_id, type: "post", data: $("#formSave").serialize(), success: function(d) { alert('saved'); } });
In Chrome it more often than not saves fine.
Safari and chrome, the alert() is not called and only sometimes is the information saved.
Questions are: 1. am I calling ajax correctly (i have initiated this in the index file). 2. are there reasons it saves sometimes and not others and appears to work in other browsers.
Apologies, hope this is enough detail to be posting on here for the first time