We are trying to create an add-on for a specific platform, this add-on will monitor the fields and post the fields as soon as the form is submitted. We don't have access over the form and aren't possible to change the HTML, so we tried to do it merely with HTML.
$(window).load(function () {
$(document).ready(function () {
$('.gui-button-action').click( function() {
console.log('Button Clicked');
var values = $('#post-form').serialize();
var baseURL = 'http://js.com/get?&';
$.get(baseURL+values, function(){});
});
})
})
The above script is fired when the #gui-button-action is clicked. However the request to the other server isn't made.
If I add one line of code, only an alert, the script fires the same and the "GET" request is fired to the other server.
$(window).load(function () {
$(document).ready(function () {
$('.gui-button-action').click( function() {
console.log('Button Clicked');
var values = $('#post-form').serialize();
var baseURL = 'http://js.com/get?&';
alert('test'); // line added
$.get(baseURL+values, function(){});
});
})
})
What is the cause and how can I work around it?