日期:2014-05-16 浏览次数:20397 次
<respone>
<?php
echo '<code>code abc</code>';
echo '<message>You had requested a test.</message>';
echo '<view><button id="lala">This prase as html.</button></view>';
echo '<script_src><script>$("#lala").click(mess);function mess(){alert("Script loaded.");}</script></script_src>';
?>
</respone>
function handleSuccess(data){
var message=$(data).find("message");
var code=$(data).find("code");
var view=$(data).find('view');
var script_src=$(data).find('script_src');
$("#div_code").empty();
$("#div_code").append(code.text());
$("#div_message").empty();
$("#div_message").append(message.text());
var button='<button id="lala">'+view.text()+"<" + "/button>";
$("#div_view").empty();
$("#div_script").append(button);
var some='<script>'+script_src.text()+"<" + "/script>";
$('#div_script').append(some);
}
$("#lala").click(mess);
$("#lala").live('click',mess);