单击按钮后Div消失,而不是重新加载

The following code is to reload a div(with id="r") in the html document. At first it loads the data correctly as "Logitech". However, on clicking the button, Fetch, which was designed to reload the data in the div mentioned above. Now I know I have not changed the value of the property $variable, and don't expect any changes in the div to happen, but what happens actually on clicking the button Fetch is all of the data in the div disappears. Can someone tell me what changes should I do in the $("div#r").load(location.href+" div#r>*",""); part of the code(or some other part where the mistake lies, I said this because I think this is where the problem is present).

<?php
class Some_class{
public static $variable = 'Logitech';
}
?>

<div id="r"><?php echo Some_class::$variable?><?div>
<button id="t">Fetch</button>

<script>
$(document).ready(function(){
$("#t").click(function(){
        $("div#r").load(location.href+" div#r>*","");
    });
});
</script>
评论