[英]How to add <noscript> tags to headlink()->appendStylesheet() in Zend?
I am using a plugin that has a noscript tag, which is an alternative for browsers that have javascipt disabled. 我正在使用具有noscript标记的插件,这是禁用了Javascipt的浏览器的替代方法。 -source
-资源
The code I am using in the action is: 我在操作中使用的代码是:
$this->view->headLink()->appendStylesheet('/css/my.css');
However this just appends it as is, I would like the script to be within a <noscript></noscript>
tag. 但这只是按原样追加,我希望脚本位于
<noscript></noscript>
标记内。
The docs says: 文档说:
appendStylesheet($href, $media, $conditionalStylesheet, $extras)
But I am still unsure how I would go about this? 但是我仍然不确定该如何处理?
According to my assumption dude ... 根据我的假设,伙计...
Don't go for the hardest thing. 不要为最难的事情而努力。 Just type the code
只需输入代码
<noscript>
<div>
<h4>Warning!</h4>
<p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p>
</div>
</noscript>
您可以使用它来获得更好的解决方案。
echo $this->view->layout()->scriptTags = '<noscript>No Javascript</noscript>';
Try Healink helper to add inline javascript in to your view 尝试使用Healink助手将内联javascript添加到视图中
please refer AppendScript with detail 请详细参考AppendScript
<?php $this->headScript()->appendScript('<noscript></noscript>',
$type = 'text/javascript') ?>
hope this will sure work for you. 希望这对您一定有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.