开发者

jquery refresh the iframe but it is not permanent

开发者 https://www.devze.com 2023-01-21 06:34 出处:网络
$(\'#id开发者_开发技巧OfMyButton\').click(function() { $(\'#idOfMyIframe\').attr(\'src\', \'the new url\'); });
$('#id开发者_开发技巧OfMyButton').click(function() { 
$('#idOfMyIframe').attr('src', 'the new url'); }); 

this code works and it load new url but again it refresh and back to initial status which I set in design mode it happens in a second.


Is that because you are missing return false;. To be honest your question isn't very clear.

$('#idOfMyButton').click(function() { 
  $('#idOfMyIframe').attr('src', 'the new url'); 
  return false;
});

This will prevent the button from carrying on and refresh the page

0

精彩评论

暂无评论...
验证码 换一张
取 消