I have strange errors in my logs, mostly coming from the Chrome in Macintosh, but sometimes Windows also.
In javascript I have on page:
text =+ '<img src="/pictures/' + url + '" alt="Photos" border="0" class="carousel-photo" />';
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:
<img src="/pictures/2405.jpg" alt="photos" border="0" class="carousel-photo">
But my logs note this:
http://www.mysite.net:80/pictures/' + url + '
This is of course a 404 error as it doesn't exist so I get log.
But why is the url not converted to my variable content, 2405.jpg in this example???
UPDATE 1: 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
Error 404 in:
/pictures/';text += url;text +='
UPDATE 2 Putting into CDATA didn't help (I have xhtml page), some Apple browsers are interpreting as if this is HTML :-(
UPDATE 3
This is wierd. It seems the only way I could put stop on this is to use:
txt += "<img src='\/pictures\/" + elm.find('url').text()+ "' alt='Photo' border='0' class='carousel-picture'>";
instead of
var url = '\/pictures\/' + elm.find('url').text();
txt += "<img src='" + url + "' alt='Photo' border='0' class='carousel-picture'>";
UPDATE 4: 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.