Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript variables in Chrome
    primarykey
    data
    text
    <p>I have strange errors in my logs, mostly coming from the Chrome in Macintosh, but sometimes Windows also.</p> <p>In javascript I have on page:</p> <pre><code>text =+ '&lt;img src="/pictures/' + url + '" alt="Photos" border="0" class="carousel-photo" /&gt;'; </code></pre> <p>Then I add text using carousel and it should be and in all browsers it is (I can not debug this in my chrome unfortunately) that the image is generated:</p> <pre><code>&lt;img src="/pictures/2405.jpg" alt="photos" border="0" class="carousel-photo"&gt; </code></pre> <p>But my logs note this:</p> <pre><code>http://www.mysite.net:80/pictures/' + url + ' </code></pre> <p>This is of course a 404 error as it doesn't exist so I get log.</p> <p>But why is the url not converted to my variable content, 2405.jpg in this example???</p> <p><strong>UPDATE 1:</strong> I got another hit now I have tried adding in a separate line (pandavenger advice) from: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2</p> <p>Error 404 in:</p> <pre><code>/pictures/';text += url;text +=' </code></pre> <p><strong>UPDATE 2</strong> Putting into CDATA didn't help (I have xhtml page), some Apple browsers are interpreting as if this is HTML :-(</p> <p><strong>UPDATE 3</strong></p> <p>This is wierd. It seems the only way I could put stop on this is to use:</p> <pre><code>txt += "&lt;img src='\/pictures\/" + elm.find('url').text()+ "' alt='Photo' border='0' class='carousel-picture'&gt;"; </code></pre> <p>instead of</p> <pre><code>var url = '\/pictures\/' + elm.find('url').text(); txt += "&lt;img src='" + url + "' alt='Photo' border='0' class='carousel-picture'&gt;"; </code></pre> <p><strong>UPDATE 4</strong>: On other pages simillar code that constructs img also fails in this browsers. The only way seems to make a document.createElement("img"). But I wonder if other things are ok in this browsers as the image gets 404 not found, but link does not, for example. CDATA also doesn't help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload