Q:

Display Ajax response in HTML

I'm calling a PHP file, and it's returning the response when I view it in Firebug. However, it's not displaying on my page. I'm not sure if the success is actually firing, because I can't even run an alert, but it is working because the PHP code is firing and returning what it's supposed to.
<script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>

<script>
    $.ajax({
        type: "GET",
        url: 'https://www.example.com',
        dataType: 'jsonp',
        contentType: "text/html",
        crossDomain:'true',
        success: function (data) {
            $(".result").html(data);
        }
    });
</script>

<div class="result"></div>

A:

You need to make the ajax call on load or document ready.  The div may not exist at the time of response (page is interpreted top down).

