简体   繁体   English

呈现而不是执行的jQuery脚本

[英]jQuery script being rendered instead of executed

In a legacy application I'm working, somehow the jQuery scripts between 在我正在使用的旧版应用程序中,以某种方式之间的jQuery脚本

<script type="text/javascript"></script>

are being rendered as plain text instead of being executed. 被呈现为纯文本而不是被执行。

Does someone have a suggestion of what can cause this behavior? 有人对导致此行为的原因有任何建议吗?

如果您使用的是style: {display:block}东西,它将表现为这种风格。

Since we can not see all your code I will give you a few possible causes. 由于我们看不到您的所有代码,因此我将为您提供一些可能的原因。 1.you could have forgot a closing tag for an element above it. 1.您可能忘记了其上方元素的结束标记。 2.You could have forgot a pair of parenthesis on an element above. 2.您可能忘记了上面元素上的一对括号。 3.You might have put the tag in a wrong spot so it might print depending on it's position. 3.您可能将标签放置在错误的位置,因此可能会根据其位置打印标签。

Try to disable css. 尝试禁用CSS。 If it works fine after it, then you've styled tag 'script'. 如果之后效果良好,则为标签“ script”设置样式。

Remember to read how to ask a question here on StackOverflow 请记住在此处阅读如何在StackOverflow上提问

But based on the little information given i'll make a longshot and think it might be something with parsing, read about CDATA 但是,基于给出的少量信息,我将进行回顾,并认为这可能与解析有关,请阅读有关CDATA的信息。

And check for unclosed html tags . 检查未关闭的html标签

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

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