Hack Forums
Linking inside a iframe - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: Linking inside a iframe (/showthread.php?tid=6079091)



Linking inside a iframe - Geatzo - May 17, 2020

So im trying to copy a site the site hs a side bar

http://prntscr.com/siicq1

i have copied the functions nd got the side bar to work but ive noticed he hs links at the top inside the sidebar which links to other pages
http://prntscr.com/siidkm

He uses code like this
PHP Code

<?php 
<li class="menu-tab" onClick="membersTab('view=top_pokemon', 0); return false;">Top Pokémon</li> 

I am trying to work out what page is it calling? can i edit these to link to my own pages i have been trying most of the day but when i change the onlink and link the text it just opens the page in a new tab every time and not inside the side bar

PHP Code

<?php 
<li  class="menu-tab" ><a href="rich.php">Your Text</a></li> 

Ive also added
PHP Code

<?php 
<base target="_parent"> 
but this does not work so i simply want to edit these links at the top to go to my own pages


RE: Linking inside a iframe - Charger - May 17, 2020

Not php

Also, you can’t. You’ll need your links to call javascript that will then invoke an element in the iframe. An iframe is basically just a body element and contains everything.


RE: Linking inside a iframe - Geatzo - May 17, 2020

(May 17, 2020 11:13 AM)Charger Wrote:  Not php

Also, you can’t. You’ll need your links to call javascript that will then invoke an element in the iframe. An iframe is basically just a body element and contains everything.
PHP Code

<?php 
<li class="menu-tab" onClick="membersTab('view=local_top_trainers', 0); return false;">Local Top Trainers</li>
<
li class="menu-tab" onClick="membersTab('view=top_richest', 0); return false;">Richest Users</li>
<
li class="menu-tab" onClick="membersTab('view=top_pokemon', 0); return false;">Top Pokémon</li>
<
li class="menu-tab" onClick="membersTab('view=top_clans', 0); return false;">Top Clans</li>
<
li class="menu-tab-end menu-tab" onClick="membersTab('view=seasonal_top_trainers', 0); return false;">Seasonal Top Trainers</li> 

These are his link so what element is he calling?So i can look inside his js file for each link


RE: Linking inside a iframe - Charger - May 17, 2020

(May 17, 2020 11:26 AM)youtubehitincreaser Wrote:  
PHP Code

<?php 
<li class="menu-tab" onClick="membersTab('view=local_top_trainers', 0); return false;">Local Top Trainers</li>
<
li class="menu-tab" onClick="membersTab('view=top_richest', 0); return false;">Richest Users</li>
<
li class="menu-tab" onClick="membersTab('view=top_pokemon', 0); return false;">Top Pokémon</li>
<
li class="menu-tab" onClick="membersTab('view=top_clans', 0); return false;">Top Clans</li>
<
li class="menu-tab-end menu-tab" onClick="membersTab('view=seasonal_top_trainers', 0); return false;">Seasonal Top Trainers</li> 

No. You have to select the iframe and then select the li element. Then you can do that element.click
These are his link so what element is he calling?So i can look inside his js file for each link



RE: Linking inside a iframe - Geatzo - May 18, 2020

i have just noticed he has all ready built a function to link the pages

https://stackoverflow.com/questions/61871776/javascript-linking-inside-a-iframe

can anyone tell me were the links are pointing to ?

here are my links
https://pastebin.com/dYfqT1TK


then this is the script
https://pastebin.com/DQTe3vPq


So it looks like to me its just adding .html to the end? the links work but says it cant fin the page so i need to build the pages one of the pages are ignore_list.html im guessing?


RE: Linking inside a iframe - Mr. Krill - May 23, 2020

i was actually looking for something like this, perfect thank you!