I've been struggling with this for a few days now and can't figure out why this won't work. I need to update a link on a page with a new file. The post request and new file show in the Google Chrome development network, but the actual page won't update. I have checked other posts and can't figure this out. My understanding is that my code should be updating the div "mapData" with the new link, image, etc. The page response in the development window has the correct html page and I need to take the div portion from it, change it in the html page displayed, and have that page update. Should be simple!
function updatePieFact(){
var scenario = $("#scenario").val();
var year_run = $("#year_run").val();
var actType = $("input:radio[name=actType]:checked").val();
var znType = $("input:radio[name=znType]:checked").val();
var data = {'pieFact': pieFact, 'csrfmiddlewaretoken':'f89lua2QMAt7oz6057PVcahr3EUsSTyI', 'scenario':scenario, 'year_run':year_run, 'actType':actType, 'znType':znType};
$.post(URL, data, function(data){
var result = $('<div />').append(data).find('#mapData').html();
$("#mapData").html(result);
});
}
var pieFact = 1;
$(document).ready(function(){
$('#bttnMinus').click(function(){
pieFact*=0.75;
updatePieFact();
});
$('#bttnPlus').click(function(){
pieFact*=1.25;
updatePieFact();
});
});