我正在尝试从a标签中获取href属性,并将其应用为锚标记的子项的背景图像。由于某种原因,它无法正常工作
我有以下html:
tf.nn.ctc_loss
以下javascript(使用jquery):
<div class="large-unit picture" itemscope itemtype="http://schema.org/ImageGallery">
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="IMAGES/Gallery_PERSONAL/librarysession.jpg" itemprop="contentUrl" data-size="1500x2100" data-index="1" title="">
<div class="thumbnail" itemprop="thumbnail"></div>
</a>
</figure>
</div>
答案 0 :(得分:4)
你应该这样做:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
Ping server using
<select id="approachOptions">
<option value="ajax">AJAX</option>
<option value="image">Image Trick</option>
<option value="jsonp">JSONP</option>
<option value="getscript">$.getScript()</option>
</select>
<table>
<tr>
<th>Website</th>
<th>Status</th>
<th>Uptime</th>
</tr>
<tr>
<td>Google</td>
<td>
<label id="googleStatus"></label>
</td>
<td></td>
</tr>
<tr>
<td>Dummy Site</td>
<td>
<label id="dummySiteStatus"></label>
</td>
<td></td>
</tr>
<tr>
<td>JS Fiddle</td>
<td>
<label id="jsfiddleStatus"></label>
</td>
<td></td>
</tr>
<tr>
<td>Lorem Pixel</td>
<td>
<label id="loremStatus"></label>
</td>
<td></td>
</tr>
</table>