Sampath
Sampath

Reputation: 65880

Set iFrame src value dynamically

HTML

    <a onclick="readMore('<%:p.Link %>')" class="actionButton">READ MORE</a>

  <iframe id="iFrameBlog"></iframe>

JS

  var readMore = function (blogUrl) {
        $('#iFrameBlog').src = blogUrl;
    };

My Question : When above hyper link clicks,I need to show that url on iFrame's src and need to show that page.But iFrame always stays as empty.Any help ?

enter image description here

Upvotes: 0

Views: 13526

Answers (1)

Krish R
Krish R

Reputation: 22721

Try this,

 $('#iFrameBlog').attr('src', blogUrl);

instead of

 $('#iFrameBlog').src = blogUrl;

Upvotes: 4

Related Questions