no_name on Nostr: cors cares how you write javascript same result, different approach, first one ...
cors cares how you write javascript
same result, different approach,
first one however is not allowed because security! what?
cors error, doesnt work:
let el = document.createElement(type)
el.id = event.id + "_" + index
el.onload = media_load
link_el.append(el.outerHTML)
container.append(link_el)
vs
this one works, no problem firefox:
let el = document.createElement(type)
el.id = event.id + "_" + index
link_el.innerHTML += el.outerHTML
container.append(link_el)
let media_el = document.getElementById(el.id)
media_el.onload = media_load
Published at
2024-01-01 23:10:47Event JSON
{
"id": "31fc132288f09d96404aa2f67ea9e9e683c645fff436124d117de123e7f74bfb",
"pubkey": "ae8942b6dd585d633e7881791ab2fbde9edcb76dff5f0388872394a08132adf8",
"created_at": 1704150647,
"kind": 1,
"tags": [],
"content": "cors cares how you write javascript\nsame result, different approach,\nfirst one however is not allowed because security! what?\n\ncors error, doesnt work:\n\nlet el = document.createElement(type)\nel.id = event.id + \"_\" + index\nel.onload = media_load\nlink_el.append(el.outerHTML)\ncontainer.append(link_el)\n\nvs\n\nthis one works, no problem firefox:\n\nlet el = document.createElement(type)\nel.id = event.id + \"_\" + index\nlink_el.innerHTML += el.outerHTML\ncontainer.append(link_el)\nlet media_el = document.getElementById(el.id)\nmedia_el.onload = media_load\n",
"sig": "23c6989036765ce45f6064b17c45b9a590335dcafcfd6a6f4ec6dea93db04b57a4b5d1bdc5d4503fb84ef59db260ceb4a2c812d1fddcffe124b0b709b9c6db83"
}