Is there a difference between `data-turbo-frame="_top` and`target="_top"` when breaking out of a frame

Hi there, hoping you’re having a good day.

So, the standard way that i thought you could break out of a frame is to use target="_top" property on the tag.

In this article the author says that you can use another way to break out of a frame, and that is by supplying data-turbo-frame="_top" to the tag.

While testing them. I noticed that there is a difference between the behaviour of both.

When using data-turbo-frame='_top' and clicking the link. After that, when you try to go back into the page(that had the frame) by pressing the browser back button. The URL is updated to the old one(that had the data-turbo-frame='_top link). But, the page is not updated.

However, using target="_top" works just fine. Pressing the browser back button will replace the URL and updates the page.

Is there a difference between both?.

Thanks for your time, and answer!.

See Turbo documentation:

It doesn’t address using data-turbo-frame or target on an a-tag, but does address how to use each attribute.