diff options
author | prashant | 2015-01-29 15:36:45 +0530 |
---|---|---|
committer | prashant | 2015-01-29 15:36:45 +0530 |
commit | 4d55002e7acd845fdf2ed3d5577751e3dedf574d (patch) | |
tree | 0b483379812f3a5c1fea902536115ae274670ef6 /js/test | |
download | tbc_comments-4d55002e7acd845fdf2ed3d5577751e3dedf574d.tar.gz tbc_comments-4d55002e7acd845fdf2ed3d5577751e3dedf574d.tar.bz2 tbc_comments-4d55002e7acd845fdf2ed3d5577751e3dedf574d.zip |
first commit added all the files
Diffstat (limited to 'js/test')
-rwxr-xr-x | js/test | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,36 @@ + $(document).ready(function(){ + + var basePath = Drupal.settings.basePath; + var modPath = basePath + "comments/"; +//function changeLikeDislike(type,id){ + +$("#likebt").click(function(){ +var type = $("#likebt").attr('data-name'); +var id = $("#likebt").attr('data-bid'); +console.log("###"); + var dataString = 'id='+ id + '&type=' + type; + $("#product_flash_"+id).show(); + $("#product_flash_"+id).fadeIn(400).html('<img src="' +modpath+'image/loading.gif" />'); + $.ajax({ + type: "POST", + url: modPath + "ajax/", + data: dataString, + cache: false, + success: function(result){ + if(result){ + var position=result.indexOf("||"); + var warningMessage=result.substring(0,position); + if(warningMessage=='success'){ + var successMessage=result.substring(position+2); + $("#product_flash_"+id).html(' '); + $("#product_"+type+"_"+id).html(successMessage); + }else{ + var errorMessage=result.substring(position+2); + $("#product_flash_"+id).html(errorMessage); + } + } + } + }); +}); +}); + |