Line | |
---|
1 | /** |
---|
2 | * ----------------------------------------------------------------------------- |
---|
3 | * file: markup.formMail.js |
---|
4 | * file version: 1.0.0 |
---|
5 | * date: 2011-09-20 |
---|
6 | * |
---|
7 | * JS file provided by the piwigo's plugin "GrumPluginClasses" |
---|
8 | * |
---|
9 | * ----------------------------------------------------------------------------- |
---|
10 | * Author : Grum |
---|
11 | * email : grum@piwigo.com |
---|
12 | * website : http://photos.grum.fr |
---|
13 | * PWG user : http://forum.phpwebgallery.net/profile.php?id=3706 |
---|
14 | * |
---|
15 | * << May the Little SpaceFrog be with you ! >> |
---|
16 | * ----------------------------------------------------------------------------- |
---|
17 | */ |
---|
18 | $(window).bind('load', |
---|
19 | function () |
---|
20 | { |
---|
21 | |
---|
22 | $('#iSubmit').bind('click', |
---|
23 | function () |
---|
24 | { |
---|
25 | var data = { |
---|
26 | email:$('#iEmail').val(), |
---|
27 | subject:$('#iSubject').val(), |
---|
28 | msg:$('#iMessageContent').val(), |
---|
29 | token:$('#iToken').val(), |
---|
30 | ajaxfct:"public.contact.sendMsg" |
---|
31 | }; |
---|
32 | |
---|
33 | $.ajax( |
---|
34 | { |
---|
35 | type: "POST", |
---|
36 | url: "plugins/GrumPluginClasses/gpc_ajax.php", |
---|
37 | async: true, |
---|
38 | data: data, |
---|
39 | success: |
---|
40 | function(msg) |
---|
41 | { |
---|
42 | result=$.parseJSON(msg); |
---|
43 | if(result.result) |
---|
44 | { |
---|
45 | $('#iGpcFormMail').html(result.msg); |
---|
46 | } |
---|
47 | else |
---|
48 | { |
---|
49 | alert(result.msg); |
---|
50 | } |
---|
51 | } |
---|
52 | } |
---|
53 | ); |
---|
54 | } |
---|
55 | ); |
---|
56 | |
---|
57 | } |
---|
58 | ); |
---|
Note: See
TracBrowser
for help on using the repository browser.