Javascript – change src of iframe and then reload the iframe


I managed to change an iframe's src with javascript

var path='images/tattoo/fullsize/';
var h=$('#borderlessFrame').height();
var bigFrame=$('#borderlessFrame');
function loadGallery(num)
    var galPath=path + num;             // path to the image
    var source=bigFrame.attr('src');
    source='i load some address here';

But for now i see the old content of the iframe , is there a way to reload the iframe ( only iframe not the whole page)
The thing i am trying to achieve is a simple gallery , thumb pictures on the bottom and a large picture on the top ( iframe ). On click on any of the thumbs , i change the content of the iframe without reloading the actual page.

Keep in mind that i am new to html/javascript/jquery.
So basically i need a way(function?) to reload the iframe.

Best Solution

To set attribute, you need to call .attr( attributeName, value )

Try this:

var source='i load some address here';
bigFrame.attr('src', source);


jQuery .attr()