简体   繁体   English

Dreamweaver在PHP文件中的脚本标记附近显示红线

[英]Dreamweaver Shows Red Line Near Script Tag In PHP File

Here is my code in product.php file where a red line is shown by dreamweaver editor when i try to add the constant path of my own which i define in my php configuration.php file. 这是我在product.php文件中的代码,当我尝试添加自己在php configuration.php文件中定义的自己的常量路径时,dreamweaver编辑器会在其中显示红线。 Here is the snapshot so you can understand properly. 这是快照,因此您可以正确了解。 my product.php file snapshot is here 我的product.php文件快照在这里

<?php require_once('header.php'); ?>


<script type="text/javascript">
    $(document).ready(function() {
       $('#search_div').get(0).scrollIntoView();  
    });
</script>

<script type="text/javascript" src="<?php echo BASE_PATH;?>js/jssor.js"></script>
<script type="text/javascript" src="<?php echo BASE_PATH;?>js/jssor.slider.js"></script>

I tried but can't able to fix the error. 我尝试过,但无法修复错误。 Please, any help would be appreciated. 请任何帮助将不胜感激。

put your javascript tag's code with src attribute ie with source file above the document.ready script and right after the php code where you call your header.php file like this 将带有src属性的javascript标记的代码放入代码,即源文件位于document.ready脚本上方,并在php代码之后,像这样调用header.php文件

<?php require_once('header.php'); ?>

<script type="text/javascript" src="<?php echo BASE_PATH;?>js/jssor.js"></script>
<script type="text/javascript" src="<?php echo BASE_PATH;?>js/jssor.slider.js"></script>

<script type="text/javascript">
        $(document).ready(function() {
           $('#search_div').get(0).scrollIntoView();  
        });
</script>

When you write any coded script tag in the php file make sure that your coded script tag should be called below the script tag in which you call your javscript source file with php define constants. 当您在php文件中编写任何编码脚本标签时,请确保应在脚本标签下调用编码脚本标签,在该脚本标签中使用php define constants调用javscript源文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM