jQuery AJAX Refresh in an iFrame

Tinkering around with a jQuery enabled Drupal module today, I was trying to make an iFrame that continuously updated. I tried the typical meta-tags and window.location.refresh() javascript but I wasn't satisfied with constant progress bar on the page. An AJAX (or AHAH really) request was needed to make this work smoothly. The trick was combining some standard javascript selectors with the jQuery $ function. Here's my iframe:
<iframe name="script-console" id="script-console" src="console.html"></script>
And this is what was needed to select the top-level HTML tag within my iframe. Note that the 'script-console' used below is the name attribute of the iframe, not the id.
$('html', window.frames['script-console'].document);
So now to actually add the jQuery request and modify the iFrame:
  function refreshConsole() {
    $('body', window.frames['script-console'].document).loadIfModified("mytextfile.txt");
    setTimeout("refreshConsole()", 1000);
  }
 
  $(document).ready(function() {
    refreshConsole();
  });
This code (placed the HEAD tag of the page), defines a refreshConsole function. Every second (1000 milliseconds), refreshConsole calls itself again. Every call, jQuery check the file "mytextfile.txt" for changes. If it's been updated, it retrieves the text and replaces the contents of the iFrame's BODY tag.

thank you tihis frikik an necati firiki sayfasi

=) xxd thanks youu

thank you very much

Keep up the good work!
Thanks. Your time isn't going to waste with your posts.
______________
John | Bubble letters

Great travesti arama sitesi travesti resources, porno , porno izle porno thank Arnavutkoy SATILIK arsa you!
nice….

Great article. There's a lot of good {information|data|info} here, though I did want to let you know something - I am running {Ubuntu|Fedora|Redhat|Mac OS X} with the {latest|current|up-to-date|circulating} beta of Firefox, and the {design|layout|look and feel} of your blog is kind of {funky|bizarre|quirky|flaky} for me. I can {read|understand} the articles, but the navigation doesn't {work|function} so {good|well|great}.

Thanks for {writing|publishing} about this. There's a {lot|mass|bunch|heap} of {great|solid|good|important} tech {information|info} on the internet. You've got a lot of that info here on your {site|website|web site}. I'm impressed - I try to keep a couple blogs {reasonably|pretty|fairly|somewhat} {current|up-to-date|live|ongoing|on-going}, but it's a struggle sometimes. You've done a {great|solid|big} job with this one. How do you do it?
headache, headache types, toothache

Santé Santé

Comment se débarrasser des cicatrices d'acné Comment se débarrasser des cicatrices d'acné

How to get rid of acne scars How to get rid of acne scars
health and free card sharing free card sharing free card sharing

iyinet frmtr trkygnclr webmaster seo yar??mas? iyinet frmtr trkygnclr webmaster seo yar??mas? iyinet frmtr trkygnclr webmaster seo yar??mas?

Thanks. fX15 için bir link eleyeyim de sitemiz üst s?ralardaki yerini korusun ? Ne dersiniz fx15 zay?flama hap? içinn tercih etmeniz gereken bu adreste ?u linki deiyinet frmtr trkygnclr webmaster seo yar??mas? unutmayal?m. Özellikle iyinet frmtr trkygnclr webmaster seo yar??mas? kelimesini sak?n unutmay?n.

Thanks for the code, I with this will solve my iframe problem.
?????

Thanks man http://divxevi.com - divx indir

i can speak no bolu in

thanks for this good share

I tried the typical meta-tags and window.location.refresh() javascript but I wasn't satisfied with constant progress bar on the page

I tried the typical meta-tags and window.location.refresh() javascript but I wasn't satisfied with constant progress bar on the page
istanbul evden eve nakliyat and is perfect
evden eve nakliyat

Saç dökülmesi, modern çag insaninin önemli sorunlarindan birisidir. Özellikle erkeklerde saç dökülmesigenetik faktörlere baglidir. Saç dökülmesi estetik kaygilara, psikolojik sorunlara ve kendinegüven eksikligine neden olabilmektedir.
Ülkemizde, çogu alanda oldugu gibi medikal ve cerrahi estetikte ve saç ekiminde de etik disi ve yasalara aykiri uygulumalara maalesef sikça rastlanilmaktadir. Saç ekimi ciddi bir istir. Yasalarimiza göre saç ekimi plastik cerrahlar tarafindan, ameliyathane kosullarinda, cerrahi merkezlerde yapilmalidir.
Yasam Hastanesi Saç Ekimi medikal ve cerrahi estetik alaninda ve saç ekimi konusunda plastik cerrahlardan olusan uzman kadrosuyla, yasal, güvenilir ortamiyla hizmetinizdedir. Yasam Hastanesi Saç Ekimi 'nde 15'i uzman doktor, 20'si saglik ve teknik görevli olmak üzere 45 kisilik bir ekip görev yapmaktadir.

evlilik sitesi, evlilik siteleri

e-ticaret dunyadaki ticaret anlayisinin internet ortam?n? yani sanal ticarete yonelmesi ile ilerlemistir e-ticaret yaparken saglam bir alt yapi olmal?d?r e-ticaret geliri yuksek bir sistemdir sizde e-ticaret e gecin

Thank you for the links. They were interesting posts...

Interesting information space. I like it. thanks for sharing. support me Rahasia Dahsyat Hidup Sukses and article Investasi Online or Start Sharing Not Selling | Travel Jakarta Bandung | Travel Day Trans | Investasi Online | Travel Day Trans

telefon dinleme cihazlar? thnx its nice comment..

resources and information about .and
online casinos on the internet right here

vJust to cope with your feelings,ugg knock offsto achieve.
Only to find the most suitable for their other half,ugg knock offscan do.
If you are still hesitant to take a look at ourugg knock offs, there is love at first sight may occur.

Thank you very much for comments. I stainless steel industry
Paslanmaz
I Hardware
Thin Client

Are you planning to buy a pair of ugg bailey button boots? As you know that Ugg boots are renowned for their quality and comfort, but these Ugg boots on sale is a blend of style, glamor, quality and comfort forever. Without thinking much you can use these ugg boots in the freezing, as they protect your feet dry and warm. Ugg Bailey will make your feet feel comfortable and do not get cold.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <div> <img> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.