使用以下代码加载div
中的外部文件CODE
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.reveal').on('click', function(e){
e.preventDefault();
var link = $(this).attr('href');
$('.page').load(link);
});
});
</script>
<p class="flaticon-right127"><a class="reveal" href="car.php">Mobile Phones</a>
<p class="flaticon-right127"><a class="reveal" href="tablet.html">Tablets</a></p>
<p class="flaticon-right127"><a class="reveal" href="accessories.html">Mobile Accessories</a></p>
<div class="page"></div>
当我点击链接外部页面打开,但我想在div上的同一页面加载外部文件
car.php
<html>
<body>
external page
</body>
</html>