Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript how to add target="_parent" in document.location.href

document.location.href="http://verttgrettest.com/testpaper.aspx?VideoId=1"

Javascript how to add target="_parent" in document.location.href

like image 396
Ghostman Avatar asked Aug 01 '26 21:08

Ghostman


1 Answers

You can't, the .href is literally just the URL you want to redirect to. You have to directly change the .href of the frame you want to target, not the href of the window/frame you're in e.g.

parent.document.location.href = 'http://...'
like image 76
Marc B Avatar answered Aug 04 '26 12:08

Marc B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!