简体   繁体   中英

PHP file with JavaScript Extjs

A noob question here, by a novice programmer.

I am trying to do a javascript inside a .php file, in my index I included this line:

<script type="text/javascript" src="/js/basic.php"></script>

And in my basic.php:

<?php Header("content-type: text/javascript"); ?>
<script>
    Ext.Loader.setConfig({
        enabled: true,
        disableCaching: false,
        paths: {
            "Extensible": "/js/extensible/src",
            "Schedule.Calendar.data": "/js/data",
            "Schedule.Calendar.listeners":"/js/listeners",
            "Schedule.Calendar.override":"/js/override",
            "Schedule.Calendar.panels": "/js/panels"
        }
    });
</script>

And it keeps sending an error saying:

SyntaxError: missing } in XML expression

The basic.php file should only be outputting pure JavaScript. The <script> tags are HTML and are not needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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