tags:

views:

21

answers:

1

hi

$('#idOfMyButton').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.

+2  A: 

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

Mouhannad
use event.preventDefault() rather than return false!
PetersenDidIt