2

I have the following code:

[..]
var img = document.createElement('img');
img.src = 'www.example.com/pixeltracking';
[.. more stuff..]

that works well in Chrome but in Firefox I've never saw finish the request.

When I add the image to the DOM, now Firefox finish the load but chrome stop the code execution without any error message.

[..]
var img = document.createElement('img');
img.src = 'www.example.com/pixeltracking';
document.body.appendChild(img);
[.. more stuff..]

Any idea? Thanks

4

1 回答 1

0

您的代码的问题是您忘记http://了网址。现在您正尝试加载www.example.com/pixeltracking 对于当前 URL 的内容,例如http://yourdomain.com/foobar/www.example.com/pixeltracking.

于 2012-07-01T10:54:28.227 回答