Answer the question
In order to leave comments, you need to log in
How can I make content open when clicked?
<head>
<meta http-equiv="Content-Type" content="text/html; Charset=UTF-8">
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<p>Какую страницу желаете открыть?</p>
<form>
<input id="btn1" type="button" value="Страница 1">
<input id="btn2" type="button" value="Страница 2">
</form>
<div id="content"></div>
<script>
$(document).ready(function(){
$('#btn1').click(function(){
$.ajax({
url: "geography.php",
cache: true,
success: function(html){
$("#content").html(html);
}
});
});
$('#btn2').click(function(){
$.ajax({
url: "page2.php",
cache: false,
success: function(html){
$("#content").html(html);
}
});
});
});
</script>
Answer the question
In order to leave comments, you need to log in
but it restarts only after the second button press
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question