我正在尝试在Head中插入一个新的元标记,我正在使用内容管理系统,该系统不允许在头部内进行编辑,因此我尝试使用jQuery执行此操作.不幸的是我无法工作.
这是我添加到以下网页的代码:http://www.newcastlegateshead.com
<script type="text/javascript">
$("head").append("<meta name=viewport content=width=400, initial-scale=0.45, minimum- scale=0.45/><link rel=apple-touch-icon href=/images/customIcon.png/><meta name=apple-mobile-web-app-capable content=no /><meta name=apple-mobile-web-app-status-bar-style content=black-translucent /><link rel=apple-touch-icon-precomposed href=/images/customIcon.png/> ");
</script>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Jquery首先识别span标记中的特定单词,然后为嵌套的div的背景着色.HTML如下所示:
<div class="highlight item1 ll3">
<div class="Image">
<h2 class="Name">
<div class="type">
<span>Workshop</span>
</div>
<div class="Dates">
<p class="Desc">Toddlers are especially welcome to BALTIC on Tuesdays. Join
in the fun, as a BALTIC artist leads a practical session using a variety of
materials,...
</p>
Run Code Online (Sandbox Code Playgroud)
所以我认为我需要使用Jquery来识别是否等于"Workshop"然后用div highlight为div着色(例如将背景设置为#000).我需要重复这一点,以便为每个具有不同值的div.highlight赋予不同的颜色.
非常感谢提前.
贾森