Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27
  1. #21

    Default Re: javascript delay?


    Try daw ni bro if mo work ba sa imo wala nako ni gi test

    Code:
    function getData() {
       $.ajax({
         url: "somelink.php",
         type: "GET",
         success: function(response){
           $('#total').text(response);
           $('#divID').html('<img src="images/check.png" width="20" height="20" /> SUCCESSFULLY UPDATED DATA!').delay(5000).hide();
         }
       });
    }
    if naa ka data e pass butangi lang paramater before sa success: like

    Code:
    data: formdata
    if imong data gikan sa form insert this line before $.ajax

    Code:
     var formdata = $("#yourformID").serialize();
    of course naa ka jquery sa imong header ani.

    dili pako expert ani bro sa katong mga expert correct me if i'm wrong lng.

  2. #22

    Default Re: javascript delay?

    OT. Try checking jQuery bai medyo old school na kaau ning XMLHttpRequest.

  3. #23

    Default Re: javascript delay?

    Quote Originally Posted by prokops
    Try daw ni bro if mo work ba sa imo wala nako ni gi test
    Code:
    function getData() {
       $.ajax({
         url: "somelink.php",
         type: "GET",
         success: function(response){
           $('#total').text(response);
           $('#divID').html('<img src="images/check.png" width="20" height="20" /> SUCCESSFULLY UPDATED DATA!').delay(5000).hide();
         }
       });
    }
    if naa ka data e pass butangi lang paramater before sa success: like
    +1. Didn't test it but this looks like it would work.

    However, slight optimization and aesthetics can be made.

    HTML Markup:
    Code:
        <button onclick='getData()'>Update Data!</button>
        <div id='divID'></div>
        <div id='total'></div>
    jQuery Script:
    Code:
    function getData(){
        $.get("somelink.php", function(data){
            $('#divID').show().html('<img src="images/check.png" width="20" height="20" /> SUCCESSFULLY UPDATED DATA!').fadeOut(2000);    
            $('#total').html(data);
        });
    }
    Where data is the stuff you echo out from your 'somelink.php' page. If you don't need it. Just remove it from the function parameters and remove this line altogether:
    Code:
        $('#total').html(data);

  4. #24

    Default Re: javascript delay?

    waaaaaaaa! amazing! ang akong taas kayu nga code sa ajax ni gamai nalang...cooool!!! salamat kayu. interesadoi najud nuon ko mag jquery :> thank you so much ^^

    nakoi pahabol 1 last tiny problem.
    ganahan ko ig fadeout niya, ang mu fadeout is ang image ug text ra, dili ma apil ang div. ako gi tryan ang fadeTo pero pas2x man kayu ang 'slow' ato >.< is there another way? :>

  5. #25

    Default Re: javascript delay?

    Aw, depende nana sa imo gusto sa design brader. Like if nahan ka ang "message" kay before or after sa content sa imo "divID" na element.

    Mas maayo jd if imo i-lahi ug div ang "message" nmu. But if ganahan jd ka, you can simply add an element around the items you want to disappear.
    Code:
    <span><img src="https://www.istorya.net/forums/images/check.gif" /> SUCCESSFULLY UPDATED DATA!</span>
    You will also have to change a few other things too.
    Code:
    function getData(){
        $.get("somelink.php", function(data){
            $('#divID').prepend('<span><img src="https://www.istorya.net/forums/images/check.gif" /> SUCCESSFULLY UPDATED DATA!</span>');
            $("span").show().fadeOut(2000, function(){ $("span").remove() });    
        });
    }
    ako gi tryan ang fadeTo pero pas2x man kayu ang 'slow' ato
    You will have to elaborate more, I'm not sure I understand this question.

    You can place a number instead of the word 'slow' as a parameter to these functions.

    ie.
    Code:
    $("element").fadeTo(x) // where x is the number of milliseconds you want your animation to take
    Note: Daghan kaayo kog gi-add na cheche bureche sa code kay wala ko kbaw unsay requirements nmu. If minimal ra, pde pa kaayo ni i-optimize. Feel free to ask here. =)

  6. #26

    Default Re: javascript delay?

    woohoo! heaven sent! salamat kayu sir! imu jud gi possible tanan. problem solved! Thank you everyone!

  7. #27

    Default Re: javascript delay?

    And once again all was well in the magical kingdom called istorya.net thanks to that son of bitch, kamahak. ^^

  8.    Advertisement

Page 3 of 3 FirstFirst 123

Similar Threads

 
  1. javascript delay
    By c-chan in forum Programming
    Replies: 7
    Last Post: 07-29-2011, 06:03 AM
  2. Activation Mail request too much delayed!
    By lytbabe in forum Support Center
    Replies: 9
    Last Post: 03-14-2006, 05:50 PM
  3. Nokia N91 Has Been Delayed
    By samsungster in forum Gizmos & Gadgets (Old)
    Replies: 0
    Last Post: 09-22-2005, 12:01 PM
  4. wat does javascript:void means?
    By etgo in forum Computer Hardware
    Replies: 3
    Last Post: 09-12-2005, 07:36 AM
  5. PM delayed?
    By softtouch in forum Support Center
    Replies: 5
    Last Post: 07-12-2005, 09:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top