Jquery and php

hello, how to make for example: when i press on button it disappears and shows word?

Is this a static word? Or does it come from another program? Should this happen in the browser or should the button cause the page to reload?

http://docs.jquery.com/Manipulation/replaceWith#content
??

Yes this word comes from another program dinamic word. I need that this happen without reloading page. And when click i want to add value to database.

I think you can do yourself ahead:


    $("#btn").click(function(){
        $.get('test.php?a=1', {}, function(data){alert(data);},'json');
        $(this).val('Dont Click Me');
    });

You will find your answer within the page of this book - Bulletproof Ajax

There are also many Ajax code examples that you can download and experiment with.

Thank you for your code :wink: could you please explain what means
'test.php?a=1, or where i should put a variable in this code ?

Thank you i will look at your recommended website :slight_smile:

If you cannot afford to purchase the book, your local library should have it for you to borrow.


Paul Wilkins

$(“#btn”).click(function(){

$(“#btn”).hide();
$(“#word_id”).show();
)};

Sorry mate, that was a good attempt to help, but he’s after an Ajax solution.

Read the OP’s post #4