PHP echo似乎可以工作但不会显示在HTML中

I am trying to use a php script to generate HTML in order to save lines and what not. I am using jQuery to call my php and then put the result into a specified div as shown below:

function createSidebarRow(div, cellNum, rowName, rowDesc) {
            $("#" + div).load("createIndexSidebarRow.php?cellNum=" + cellNum + "&rowName=" + rowName + "&rowDesc=" + rowDesc);
        }

However, when this is executed the HTML is not updated on the page, I can see that the code has worked because the browser network activity confirms it. I am trying to figure out what is causing it to not update.

This is the network activity confirming the echo'd HTML.

Turns out jQuery doesn't play ball when you include spaces in the POST URL. I removed the space and used %20 instead and all is well now. Thanks for any advice.

It might be so, that the div is not yet created in the DOM. (the div that should received the html).

Are you calling createSidebarRow directly on page load?

If so, put the function call in a document ready:

jQuery(document).ready(function(){
    createSidebarRow (... );
});

Sorry for stating the obvious, but the div you are trying to fill up does exist with that particular id right?

If so, try this:

$("#" + div).load("createIndexSidebarRow.php?cellNum=" + cellNum + "&rowName=" + rowName + "&rowDesc=" + rowDesc, function() {
    alert('success');
});

If the id does exist (and it's unique) and you get an alert there should be no reason for it not to work.