<script>
function previewupload() {
$("tr.attach-row td.attach-name span.file-name a").each(function(index) {
url = this.getAttribute('href');
console.log(url);
this.before("<p>"+url+"</p>");
});
}
window.setInterval(function() { previewupload(); }, 1000);
</script>In de console-log komt de juiste URL te staan.
Maar this.before() doet het niet, ik krijg wel in de console de foutmelding:
posting.php?mode=reply&f=2&t=1:418 Uncaught TypeError: undefined is not a function
Dit slaat op de this.before()-regel.
Wat doe ik fout?