Javascript – change src of iframe and then reload the iframe

javascriptjquery

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)
{
    bigFrame=$('#borderlessFrame');
    var galPath=path + num;             // path to the image
    h=$('#borderlessFrame').height();
    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);

Reference:

jQuery .attr()