0

I am using a plugin that has a noscript tag, which is an alternative for browsers that have javascipt disabled. -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.

The docs says:

appendStylesheet($href, $media, $conditionalStylesheet, $extras)

But I am still unsure how I would go about this?

4

3 回答 3

1

根据我的假设,伙计......
不要去做最难的事情。只需输入代码

<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>
于 2013-10-09T12:32:23.590 回答
0

尝试使用 Healink 助手将内联 javascript 添加到您的视图中

请详细参考AppendScript

<?php  $this->headScript()->appendScript('<noscript></noscript>', 
    $type = 'text/javascript') ?>

希望这对你有用。

于 2013-10-09T11:47:22.257 回答
0

您可以使用它来获得更好的解决方案。

echo $this->view->layout()->scriptTags = '<noscript>No Javascript</noscript>';

于 2013-10-09T11:15:45.187 回答