-
Notifications
You must be signed in to change notification settings - Fork 0
/
pva.js
49 lines (43 loc) · 952 Bytes
/
pva.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
jQuery( document ).ready( function ( $ ) {
$('#create_post').attr('disabled',true);
$('#post_title').keyup(function(){
if($(this).val().length > 3) {
$('#create_post').attr('disabled', false);
} else {
$('#create_post').attr('disabled',true);
}
});
$('#create_post').click(function(event){
post_via_ajax();
});
// Return Post Title Field Value
function returnNewPostTitle(){
var newPostTitleValue = $('#post_title').val();
return newPostTitleValue;
}
// AJAX > Get City Posts
function post_via_ajax()
{
var pva_ajax_url = pva_params.pva_ajax_url;
$.ajax({
type: 'POST',
url: pva_ajax_url,
data: {
action: 'pva_create',
post_title: 'heerp'
},
beforeSend: function ()
{
console.log('sending');
},
success: function(data)
{
console.log('yay');
},
error: function()
{
console.log('nay');
}
})
}
});