1

According to the Turbo Handbook, there is a turbo:frame-load event, so I was trying to listen to that, but doesn't seem to work.

<turbo-frame id: "content">
</turbo-frame>


JS:
const contentFrame = document.getElementById("content")
contentFrame.addEventListener("turbo:frame-load", event => {
     console.log("Hello New Content")
})
Patrick Vellia
  • 399
  • 2
  • 9
  • 1
    On documentation: `Turbo emits events that allow you to track the navigation lifecycle and respond to page loading. Except where noted, Turbo fires events on the document.documentElement object (i.e., the element).` Did you try to attach listener on `document` instead `contentFrame` – jpheos Sep 21 '22 at 07:10

0 Answers0