Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134430

sutharsan on "Ajax coding not work in website but works in local host"

$
0
0

wp_version = '3.8';

works perfect in local host

but when i upload on host it won't work,

include the file into a " wordpress page " //include'view.php'

BUT when I open the single view.php file on server it works !

this code for like and dislikes buttons, you can see buttons
my site link

when i click the button it not working on host ! but works in local host

--------------------------------------------------
<script>
function rate(rating){ //'rating' VARIABLE FROM THE FORM in view.php
var data = 'rating='+rating+'&p_id=<?php echo $p_id; ?>&uid=<?php echo $u_id?>&aid=<?php echo $author_id; ?>';

$.ajax({
type: 'POST',
url: 'rate.php', //POSTS FORM TO THIS FILE
data: data,
success: function(e){
$("#ratings").html(e); //REPLACES THE TEXT OF view.php
}
});
}
</script>
<style>
/*GIVES THE POINTER TO THE BUTTONS ON MOUSEOVER*/
#like, #dislike {
cursor: pointer;
}
</style>


Viewing all articles
Browse latest Browse all 134430

Trending Articles