문제

I tried to embed a rich text text editor in my HTML page. The text editor works when the page is loaded seperately. But when I load the page through my django server, the Rich Text Editor does not work. the HTML page:

<html>
        <head>
                <script type="text/javascript" src="/home/aswin/python/myblog/tinymace/js/tinymce/tinymce.min.js"></script>
                <script type="text/javascript">
                tinymce.init({
                            selector: "textarea"
                             });
                </script>
        </head>
        <body>
                <form method="post" action = "/home/add/">
                    <input type = "text" value = "Title" name = "title">
                    <textarea >Hello</textarea>
                    <input type = "submit" value = "Post">
                </form>
        </body>
</html>

Can anyone help me?

도움이 되었습니까?

해결책

You are trying to load a JavaScript file from location directly on your local hard drive (/home/aswin/python/myblog/tinymace/js/tinymce/tinymce.min.js). Websites you load from a server (even a Django development server running on your local machine) are not supposed to be able to load files from user's local hard drive, so your browser blocks this.

Please, read about managing static files through Django.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top