My original post is at
http://stackoverflow.com/questions/1...y-ajax-to-post

Not sure if codingforums is against reposting a question, but I'd really like to make some progress today.

Like the forum title says, I'm making a quiz using Jquery-AJAX to take questions from the database. But Firebug's not giving me any details aside from undefined variables when I think I have defined them.

Code:
$(document).ready(function(){

    function getQuestions(){
        //In the php database, they are called answer1, answer2...
        //On this script, they are called answ1, answ2...
        //On the html, they are called ans1, ans2...

        var quest = $('#questionTxt').val();
        var answ1 = $('#answer1').val();
        var answ2 = $('#answer2').val();
        var answ3 = $('#answer3').val();
        var answ4 = $('#answer4').val();
        var hint = $('#hint').val();

        //var questNum = $('pid').val();
        var questNum = 1;

        $.ajax({
            type:   "POST",
            url:    "questionDB.php",
            data:   {pid:questNum}
            }).done(function(result){
                $("#questionTxt").text(quest);
                $("#ans1").text(answ1);
                $("#ans2").text(answ2);
                $("#ans3").text(answ3);
                $("#ans4").text(answ4);
                $("#hintTxt").text(hint);
            });
    }

    //var hint = "Whaaaaat";

    //function Question(questionTxt, questionAns);
    getQuestions();
    $("#hintTxt").fadeOut();
    $("#hintTrigger").click(function(){
        $(this).fadeOut(); //It seems to be skipping this animation.
        $("#hintTxt").text(hint);
        $("#hintTxt").fadeIn();
        $(this).remove();
    })

    console.log(questionTxt); // I get <div id="questionTxt"> in the console.
});
It's loading from questionDB.php but it doesn't look like my values are being carried back to the javascript.