<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [Javascript] syntax error, when running examples in Internet Explorer in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Javascript-syntax-error-when-running-examples-in-Internet/m-p/1026086#M40165</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;when I test the Javascript examples in my Internet Explorer, a Javascript syntax error occurs.&lt;BR /&gt;
	See attached screenshot for details.&lt;/P&gt;

&lt;P&gt;I'm using Windows 8.1 with Internet Explorer 11 (German) and latest patches/updates applied.&lt;/P&gt;

&lt;P&gt;I've nailed the root cause down to the fact, that the 'xhr.responseText' is an empty String (see screenshot).&lt;BR /&gt;
	This will result in an exception, when calling JSON.parse(&lt;SPAN style="line-height: 19.5120010375977px;"&gt;xhr.responseText&lt;/SPAN&gt;).&lt;/P&gt;

&lt;P&gt;This is my &lt;STRONG&gt;proposal for a fix&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;// file realsenseinfo-3.0.js
// ...
var xhr = new XMLHttpRequest();
var url = 'http://localhost:4182/Intel/RealSense/v3/' + JSON.stringify(components);
xhr.open("GET", url, true);
xhr.timeout = 1000;
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 &amp;amp;&amp;amp; xhr.responseText.length &amp;gt; 0) { // added additional length check
                var info = JSON.parse(xhr.responseText);
                info.responseText = xhr.responseText;
// ...&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Dec 2014 21:01:55 GMT</pubDate>
    <dc:creator>Martin_W__K_</dc:creator>
    <dc:date>2014-12-16T21:01:55Z</dc:date>
    <item>
      <title>[Javascript] syntax error, when running examples in Internet Explorer</title>
      <link>https://community.intel.com/t5/Software-Archive/Javascript-syntax-error-when-running-examples-in-Internet/m-p/1026086#M40165</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;when I test the Javascript examples in my Internet Explorer, a Javascript syntax error occurs.&lt;BR /&gt;
	See attached screenshot for details.&lt;/P&gt;

&lt;P&gt;I'm using Windows 8.1 with Internet Explorer 11 (German) and latest patches/updates applied.&lt;/P&gt;

&lt;P&gt;I've nailed the root cause down to the fact, that the 'xhr.responseText' is an empty String (see screenshot).&lt;BR /&gt;
	This will result in an exception, when calling JSON.parse(&lt;SPAN style="line-height: 19.5120010375977px;"&gt;xhr.responseText&lt;/SPAN&gt;).&lt;/P&gt;

&lt;P&gt;This is my &lt;STRONG&gt;proposal for a fix&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;// file realsenseinfo-3.0.js
// ...
var xhr = new XMLHttpRequest();
var url = 'http://localhost:4182/Intel/RealSense/v3/' + JSON.stringify(components);
xhr.open("GET", url, true);
xhr.timeout = 1000;
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 &amp;amp;&amp;amp; xhr.responseText.length &amp;gt; 0) { // added additional length check
                var info = JSON.parse(xhr.responseText);
                info.responseText = xhr.responseText;
// ...&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 21:01:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Javascript-syntax-error-when-running-examples-in-Internet/m-p/1026086#M40165</guid>
      <dc:creator>Martin_W__K_</dc:creator>
      <dc:date>2014-12-16T21:01:55Z</dc:date>
    </item>
  </channel>
</rss>

