我加载任何网页的数据,这个网页样式表会影响我的网页 Mywebpage
<html>
<head>
<script>
$('#mydiv').load('externalData.php');
</script>
</head>
<body>
<div id="mydiv" >
<h1>Here is some content</h1>
</div>
<div id="otherdiv">
//other div
</div>
<button>click</button>
</body>
</html>
externalData.php
<?php
echo file_get_contents('http://www.example.com/');
?>
我怎样才能避免这些不会影响我的div&#39; otherdiv&#39;。
答案 0 :(得分:0)
好吧,使用CSS,样式表是级联的。因此,在调用file_get_contents之后简单地设置一个不同的样式表,其中说明了div实际应该如何看。第二个样式表比file_get_contents更受青睐。