javascript - Alternatives to document.createElement to fire pixels (request image) because of inconsistent results -
javascript - Alternatives to document.createElement to fire pixels (request image) because of inconsistent results -
i have js script on server fire tracking pixel , serve appropriate file.
the 3rd party loads script source, , calls "getfile( { ... } ) function on click of site.
in js utilize this, not getting consistent results safari mac, pc, , ie (various). seems not loading properly.
function getfile(options){ if ( (!options.email) || (!options.ref3) || (!options.ref4)){ homecoming false; } downloadapp(); var url="http://www.example.com/mysrc?image=1"; (var f in options) { url=url+"&"+f+"="+encodeuricomponent(options[f]); }; var oimg=document.createelement("img"); oimg.setattribute('src', url); oimg.setattribute('alt', 'na'); oimg.setattribute('height', '1px'); oimg.setattribute('width', '1px'); document.body.appendchild(oimg); }
so seems document.body.appendchild isnt working we'd in ie / safari.
what alternative be?
--update: script fire, however, study example.com domain not able write cookies browser (for tracking purposes). seems there no work around safari. prohibit behavior.
ie requires p3p headers seems.
there no work around safari. safari requires window or tab open 3rd party set cookies. iframes not function unless window or tab open.
they flat out prohibit 3rd party sites setting cookies.
ie on other hand fixed sending p3p headers.
javascript
Comments
Post a Comment