Activity Stream
48,167 MEMBERS
6788 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1.     
    #1
    Member
    Website's:
    maxneeds.info

    Post php Pause/Wait until ..

    As i don't like to explain a lot i just give example first...

    PHP Code: 
    <iframe src=http://yahoo.com/></iframe>
    <?php
    file_get_contents
    ('something.txt');
     
    ?>
    The questions is:
    How can i pause file_get_contents until the iframe load ?
    Alternative (worse) solution is 'executing' the iframe 5 sec before file_get_contents.

    sleep() function pauses all the page
    Porsche_maniak Reviewed by Porsche_maniak on . php Pause/Wait until .. As i don't like to explain a lot i just give example first... <iframe src=http://yahoo.com/></iframe> <?php file_get_contents('something.txt'); ?> The questions is: Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Developer
    Sleep() in a language like PHP is generally a bad idea. What you need here is client <=> server communication. Thus, you'll need to implement this in JavaScript trough AJAX. IE call a PHP script from JavaScript once the iframe is loaded. I'm sure Google can assist you with the rest of it.

  4.     
    #3
    You can call me G
    ^ that is awesome! Hyperz stole my words!



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

  5.     
    #4
    Member
    Website's:
    maxneeds.info
    Tnx ..
    With jquiry done simply

  6.     
    #5
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    You can do it, dont wast your time tying.

    You can mix PHP with Client Side.

    What you need to do is like so:

    Code: 
    <iframe id="iframeID" src="http://google.com"></iframe>
    <div id="some_content"></div>
    <script>
    $('#iframeID').bind('load',function(){
        //Do an ajax call
        $.get('data.php',function(data){
            $('#some_content').html(data);
        });
    })
    </script>
    then in your data.php script echo some content.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  7.     
    #6
    Member
    Website's:
    maxneeds.info
    Tnx litewarez ..

    btw can you tell me where's the problem of this jquery :
    Code: 
    $("#img").each(function(){
    $('#img').ready(function () {
    $('#img').css('margin-left','auto');
    $('#img').css('margin-right','auto');
    $(window).load(function () {
    $('#img').toggle("slow");});
    }); });
    I am trying to toggle images on document load. The above script does it for the first match of id so i added each(the bolded one in example) so i can do it for all images using id=img ,but nothing happens

  8.     
    #7
    Banned
    ^First of all u need to know that multiple elements cant have the same ID

  9.     
    #8
    Member
    Website's:
    maxneeds.info
    @Ornlu they can if you use php foreach function ... <img id=img src='.$valuefromforeach.'>

  10.     
    #9
    Banned
    eh??
    Why do u confuse Javascript Just Remove IDs and add CLASSes.
    Or Instead use a selector like. $('div#parent img')

  11.     
    #10
    Member
    Website's:
    maxneeds.info
    Ornlu tnx 1000x
    just forgot about the class

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Legend (Wait for it...)
    By The Legend in forum Introductions
    Replies: 6
    Last Post: 30th Jun 2012, 06:15 PM
  2. 1, 2, 3,...wait! WTF?
    By upnorth in forum General Discussion
    Replies: 3
    Last Post: 12th Jan 2011, 08:42 PM
  3. Oh, got to wait for 2 days :(
    By mightyb in forum Introductions
    Replies: 2
    Last Post: 28th Jan 2010, 11:46 PM
  4. How to Pause MSDN downloads
    By sairam123 in forum General Discussion
    Replies: 6
    Last Post: 6th Jan 2010, 12:59 PM
  5. How much time i have to wait
    By waqararif in forum General Discussion
    Replies: 6
    Last Post: 21st Aug 2009, 12:15 PM

Tags for this Thread

BE SOCIAL