Javascript 加载块div Ajax

Javascript 加载块div Ajax,javascript,ajax,jquery,php-5.3,Javascript,Ajax,Jquery,Php 5.3,在页面的左侧有一个链接列表,它们加载一个名为“contained”的div块中的页面 你能帮我吗 你确定你在重复它吗?另外,如果通过ajax加载javascript,它也不会运行。我不知道如何让它在普通javascript中运行,我使用jQuery。另外,如果不需要ajax,可以使用php包含。使用php包含并不能解决我的问题。我想在不重新加载整个页面的情况下更改php页面的内容,只加载左侧div。然后在php代码中,确保您的代码在php块中是echod或not。如果您不熟悉herodoc和he

在页面的左侧有一个链接列表,它们加载一个名为“contained”的div块中的页面


你能帮我吗

你确定你在重复它吗?另外,如果通过ajax加载javascript,它也不会运行。我不知道如何让它在普通javascript中运行,我使用jQuery。另外,如果不需要ajax,可以使用php包含。

使用php包含并不能解决我的问题。我想在不重新加载整个页面的情况下更改php页面的内容,只加载左侧div。然后在php代码中,确保您的代码在php块中是echod或not。如果您不熟悉herodoc和heredoc,它们是非常有用的代码回送方式。你不必逃避其中的任何东西。此外,有些人在使用if语句时中断了php,以响应代码。ie html代码更多html代码
<div id="contenue"> </ div>.  
<script language="javascript" type="text/javascript" src="jabbax.js"></ script>.  
<a href="#" onclick="javascript:getPage('chargement_div/details.php','contenue');"> left box </ a>.  
<script type="text/javascript" >
var chartData = [ 
{country:"var1",litres:Math.round(<?php echo $pr_var1;?>)},
{country:"var2",litres:Math.round(<?php echo $pr_var2;?>)},
{country:"var3",litres:Math.round(<?php echo $pr_var3;?>)},
{country:"var4",litres:Math.round(<?php echo $pr_var4;?>)}];    
window.onLoad=function() {   
var chart = new AmCharts.AmPieChart();
chart.dataProvider = chartData;
chart.titleField = "country";
chart.valueField = "litres";
chart.depth3D = 10;
chart.angle = 12;
chart.labelRadius = -30;
chart.labelText = "[[value]]%";
chart.balloonText="[[title]] : [[value]]%"
chart.position = "center";    
var legend = new AmCharts.AmLegend();
legend.position = "right";
legend.borderAlpha = 0.5;
legend.horizontalGap = 20;
legend.markerType = "circle";
legend.switchType = "x";   
chart.addLegend(legend);
chart.write("chartdiv");
}
</script>   
<div id="chartdiv" style="height:350px;position: relative;" ></div>