0

Here's my relevant HTML:

       <div id="activity-menu">
          <h2><a id="activity-link-reddittv" href="#" data-url="https://app.herokuapp.com/reddit-tv/reddittv.html">Watch RedditTV</a></h2>
          <h2><a id="activity-link-topics" href="#">Topics</a></h2>
       </div>

       <div id="topics" style="display:none;" >
       </div> 

       <div id="#reddit-tv-div" style="display:none;" >
          <iframe id="reddit-tv-iframe" style="height:100%;width:100%;" style="border:none;"></iframe> 
       </div>

And here's my JQuery:

  $('#activity-link-reddittv').click(function(){

                var el = $(this);

                $('#activity-menu').hide();
                $('#reddit-tv-div').show();
                $('#reddit-tv-frame').attr('src', el.data('url'));

                console.log('el = ' + el); 
                console.log('el.url = ' + el.data('url')); 
                console.log('src = ' + $('#reddit-tv-frame').attr('src')); 

              });

Here's my logs:

el = [object Object] 
el.url = https://app.herokuapp.com/reddit-tv/reddittv.html
src = undefined 

The iframe doesn't show up, and based on the logs src never gets set.

This question has been answered numerous times on SO - one example. My code seems to follow these answers pero no funciona.

Community
  • 1
  • 1
OdieO
  • 6,836
  • 7
  • 56
  • 88

1 Answers1

0

i is missing in "#reddit-tv-frame". Correct the spelling.

$('#reddit-tv-iframe').attr('src', el.data('url'));
Jesuraja
  • 3,774
  • 4
  • 24
  • 48