Need to display iframe when link is clicked from m

2019-07-15 10:56发布

I am creating a website which can display a bunch of playlists I have created on 8tracks. Lets say I have 10 playlists; I want to be able to link to that iframe playlist (via the embed code which 8tracks provides) like this: http://d.pr/i/FBxn

Essentially I want the iframe to change based on which mixtape link I click on the menu (a playlist of playlists*)

I am new to JS and would appreciate anyhelp. I'm still trying to grasp the relationship between HTML and JS so this is a new area for me. Thanks so much.

2条回答
Luminary・发光体
2楼-- · 2019-07-15 11:10

You can setup anchors to target a specific iframe:

Give a name to your iframe (playframe), and set the 'src' to the default playlist (displayed when iframe is rendered)

<iframe name='playframe' src='http://path/to/playlist/1'></iframe>

Then target your links to playframe

<a href='http://path/to/playlist/1' target='playframe'>Playlist 1</a>​
<a href='http://path/to/playlist/2' target='playframe'>Playlist 2</a>​
查看更多
贼婆χ
3楼-- · 2019-07-15 11:19
登录 后发表回答