Provide a function to safely submit logs from within Javascript functions #626
Labels
duplicate
For issues that already existed in our issue tracker and were reported previously.
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Major
Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Please provide a function to safely log requests from within javascript functions which modify the DOM.
Currently, when you try to log a visit from within a Javascript function which generates HTML output, calling piwik_log results in a document.writeln which apparently clobbers “large parts” of the DOM.
We worked around this issue by using something like
```
var imgsrc = _pk_getUrlLog(‘pix/’ + io.filename, 5, pkBaseURL + ‘piwik.php’);
box.innerHTML = ‘’imgsrc+’" border="0">’;
```
in the Javascript which we use to dynamically generate our pages, but this is Bad Practice™.
The text was updated successfully, but these errors were encountered: