title: How can I fix 'Uncaught SyntaxError: Unexpected end of JSON input' error
body: <p>I'm using <a href="https://phpdolphin.co" rel="nofollow noreferrer">dolphin</a> social networking script and I have more than one languages files with json and when I pass other language then if I click homepage or another link then google chrome gave me a this error line..I read same title of stackoverflow but I couldn't get out of business.</p>
  
  <p>footnote: my script is php and I used <code>json_encode();</code> <code>utf8_encode();</code> but nothing happend because same time I have turkish character problem.</p>
  
  <p>footnote2: I changed mysql character set too and again nothing happend</p>
  
  <p><a href="https://i.stack.imgur.com/clfra.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/clfra.jpg" alt="enter image description here"></a></p>
  
  <p>Console gave me a this error </p>
  
  <pre><code>feed:1 Uncaught SyntaxError: Unexpected end of JSON input
      at Function.parse [as parseJSON] (&lt;anonymous&gt;)
      at Object.success (functions.js:2102)
      at i (jquery.js:2)
      at Object.fireWith [as resolveWith] (jquery.js:2)
      at A (jquery.js:4)
      at XMLHttpRequest.&lt;anonymous&gt; (jquery.js:4)
  </code></pre>
  
  <p>and my functions.js:2102 line</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// Request the page
  $.ajax({
    url: pageurl,
    type: type,
    data: parameters,
    success: function(data) {
      var result = jQuery.parseJSON(data);
      // Show the content
      $('#content').html(result.content);
      // Stop the loading bar
      stopLoadingBar();
      // Set the new title tag
      document.title = result.title;
      // Scroll the document at the top of the page
      $(document).scrollTop(0);
      load_modes();
      // Reload functions
      reload();
    }
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>end function of this line</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function liveLoad(pageurl, type, parameters) {
   // page url = request url
   // type = 1: POST; 0: GET;
   // parameters: serialized params
   cleanOldFid();
   startLoadingBar();
   
   if(type == 1) {
    var type = "POST";
   } else {
    var type = "GET";
   }
  
   // Request the page
   $.ajax({url: pageurl, type: type, data: parameters, success: function(data) {
    var result = jQuery.parseJSON(data);
    // Show the content
    $('#content').html(result.content);
    // Stop the loading bar
    stopLoadingBar();
    // Set the new title tag
    document.title = result.title;
    // Scroll the document at the top of the page
    $(document).scrollTop(0);
    load_modes();
    // Reload functions
    reload();
   }});
   
   // Store the url to the last page accessed
   if(pageurl != window.location) {
    window.history.pushState({path:pageurl}, '', pageurl); 
   }
   return false;
  }</code></pre>
  </div>
  </div>
  </p>