Basil, I know it might be a little late and you have probably figured it out but just in case, you place the code either into your ‘head’ or you create an external JavaScript file .js ending, just make sure you refer to it in your head.
Hopefully that’s of some help to you.
This code doesn’t work in case you have multiple iframes on a page. It replaces the url of all iframes to first one to be reloaded. More robust code jquery code would be:
$('iframe').each(function (){
var src= $(this).attr('src');
$(this).attr('src', src);
});
same without JQuery:
Because JQuery is not always needed :)
The difference is that Chris reloads all iframes whereas you only reload the first one the in the DOM tree.
how to i resolve the caching problems
Maybe I’m going way overboard, but if you wanna do it purely in JavaScript with the same results Chris got:
I can't wait for the day Chris learns how to do proper prototyping ;-)
I am newbie,
pls can you tell me where to place the code?
Basil, I know it might be a little late and you have probably figured it out but just in case, you place the code either into your ‘head’ or you create an external JavaScript file .js ending, just make sure you refer to it in your head.
Hopefully that’s of some help to you.
I’m currently using this version of the script, but it’s breaking the rest of the scripts on my page. Any idea what may be causing that?
Is that solve caching problem in IE?
I honestly only wanted to comment because your commenting system is gorgeous.
Kudos
comment preview doesn’t has funcionality , AhahahhAHHAhh
Thanks!!
How would you go about reloading 2 or more iFrames?
Thanks a lot !
Thank you very much. I’ve tried more than one way of doing this, but none really worked for me. This is the real deal! Thanks once again :)
$(‘iframe’).attr(‘src’,’Your src here ‘);
From Your text to link here…
$( '#iframe' ).attr( 'src', function () { return $( this )[0].src; } );
This code doesn’t work in case you have multiple iframes on a page. It replaces the url of all iframes to first one to be reloaded. More robust code jquery code would be:
If you want to reload all the frames inside te page you can try this
jQuery:
well in both cases, it doesn’t solve the cache problem :/