<body>
有没有办法在php中的标签之前将脚本注入页面?我已经看到了一些关于如何使用 jquery 执行此操作的示例,但是 jquery 会导致我的网站的某些部分无法正常运行,因此我需要一个 php 代码,以便我可以有选择地在页面的开始标记之前注入脚本。
IE。
.....
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src="jquery.internads.js"></script>
<script>
$(document).ready(function(){
// Call Intern Ads
$().tcInternAds({
title: "Support Our Sponsors!",
url: "adpage.html",
timeout: 10,
deplay: 0,
wait: 0,
closeable: true
});
});
</script>
<body>
<div class="xxxxx">
...............</div>
如果可能的话,我希望能够使用 php,因此我可以将代码包含在我需要调用脚本的模板文件中,同时避免全局包含。
有人能帮忙吗?
最好的,迈克