Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var post_id = 112;
- action = 'views';
- $.ajax({
- url: 'index.php',
- type: 'post',
- data: {
- 'action': action,
- 'post_id': post_id
- },
- success: function(data){
- res = JSON.parse(data);
- }
- });
- // this is resulting as follows
- // responseText: "<!DOCTYPE html>↵<html lang="en-US" class="no-js">↵.....
- // and getting error as
- /* Uncaught SyntaxError: Unexpected token < in JSON at position 0
- at JSON.parse (<anonymous>)
- at Object.success (<anonymous>:9:16) */
Add Comment
Please, Sign In to add comment