After submitting a form an Ajax message shows up at the top of the page and disappears (how to do that?)
In this page, when you submit the form the page seems to stay as it is and it just shows a message at the top of the page saying that the 开发者_运维知识库message was sent.
The only part I understood was the following code:
jQuery(function() {
var returnMessage = ['I got the message! I will get back to you as soon as I can.'];
jQuery('body').showMessage({
'thisMessage': returnMessage,
'className': 'success',
'opacity': 95,
'displayNavigation': false,
'autoClose': true,
'delayTime': 4000
});
});
I know that the code above makes the message appear at the top of the page.
But I can't see how is this Javascript code connected to the form.
Can anyone explain that to me?
Thanks!
It looks like the page uses the showMessage jQuery plugin. This plugin simply displays a message at the top, it has no connection with a form. When you navigate to the link you provided there is no need to submit a form to see the message.
The way it works is that you fill the form at the Contact page and once you submit it you are redirected to the Confirmation page which simply contains the notification message at the top.
精彩评论