How do I a link target="_parent"

Get help using Construct 2

Post » Wed Apr 23, 2014 2:59 am

Hello (excuse my english),

I use my games in iframes but I want to make a html link in the game that opens in the same window not in the iframe.

a link like this
<a href="http://..." target="_parent">text</a>

in construct 2 choices :
go to url in new window (i want use forever the first window)
or
go to url (open in the iframe)
how do i ?
Help me please. ;)
B
12
S
3
Posts: 147
Reputation: 2,021

Post » Wed Apr 23, 2014 3:43 am

I've discovered that there's no real way to configure this because it has to do with user settings and all sorts of crazy stuff.

Maybe there's more information other users have, but from what I've discovered there's not much you can do.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,826

Post » Wed Apr 23, 2014 12:04 pm

Hello DatapawWolf,


you think there are no solution ?
others may have a solution ?

Thank you
B
12
S
3
Posts: 147
Reputation: 2,021

Post » Wed Apr 23, 2014 12:19 pm

a possible solution would be using the Browser Object and the "Execute javascript" Event:
"window.parent.location.href='yourURL';"


EDIT: I have not checked the functionality in an iframe, but the code will hopefully work :)
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Wed Apr 23, 2014 8:28 pm

Thank you very much Ubivis !

it works !

yeah !
B
12
S
3
Posts: 147
Reputation: 2,021


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, SputnikCZ and 3 guests