什么是鼠标悬停时更改图像的正确方法(使用/不使用jQuery)?
<a href="#" id="name">
<img title="Hello" src="/ico/view.png" onmouseover="$(this).attr('src','/ico/view.hover.png')" />
</a>
Run Code Online (Sandbox Code Playgroud)
好的,这是有效的,但如何更改回原始图像mouseout?
如果有可能,我想在没有document.ready函数的情况下内联这个东西.
我发现了各种用于生成面包屑的解决方案,但它们都使用了元素,但我当前的痕迹是无序的列表样式.
这是我到目前为止所做的:
<div class="breadcrumb">
<ul>
<?php $seocrumbs = array_pop($breadcrumbs); ?>
<?php foreach($breadcrumbs as $idx=>$seocrumb) { ?>
<li>
<div <?php echo $idx == 0 ? '' : 'itemprop="child"'; ?> itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="<?php echo $seocrumb['url'];?>" itemprop="url">
<span itemprop="title"><?php echo $seocrumb['text'];?></span>
</a>
</div>
</li>
<?php }?>
<?php
//remove link from last item
echo $seocrumb['separator'];?> <li id="lastitem"><?php echo $seocrumbs['text']; ?></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
此代码的问题在于它生成单独的面包屑,而不是母键和子项.
<div class="breadcrumb">
<ul>
<li>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="" itemprop="url">
<span itemprop="title">Index</span>
</a>
</div>
</li>
<li>
<div itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> …Run Code Online (Sandbox Code Playgroud) 我在我的homeserver上安装了gitlab,服务器正在运行.我可以访问登录页面,但我无法登录.
admin@local.host.
5iveL!FE
错误:电子邮件或密码无效.
可能是什么问题呢?
我正在使用此脚本下载文件:
parallel --progress -j16 -a ./temp/img-url.txt 'wget -nc -q -P ./images/ {}; wget -nc -q -P ./images/ {.}_{001..005}.jpg'
Run Code Online (Sandbox Code Playgroud)
是不是可以不下载文件,只是在远程端检查它们,如果存在则创建一个虚拟文件而不是下载?
就像是:
if wget --spider $url 2>/dev/null; then
#touch img.file
fi
Run Code Online (Sandbox Code Playgroud)
应该工作,但我不知道如何将此代码与GNU Parallel结合起来.
编辑:
根据Ole的回答,我写了这段代码:
#!/bin/bash
do_url() {
url="$1"
wget -q -nc --method HEAD "$url" && touch ./images/${url##*/}
#get filename from $url
url2=${url##*/}
wget -q -nc --method HEAD ${url%.jpg}_{001..005}.jpg && touch ./images/${url2%.jpg}_{001..005}.jpg
}
export -f do_url
parallel --progress -a urls.txt do_url {}
Run Code Online (Sandbox Code Playgroud)
它可以工作,但它对某些文件失败了.我无法找到为什么它适用于某些文件的一致性,为什么它对其他文件失败.也许它有最后一个文件名的东西.第二个wget尝试访问当前url,但之后的touch命令根本不会创建desidered文件.第一个wget总是(正确地)下载没有_001.jpg,_002.jpg的主图像.
示例urls.txt:
http://host.com/092401.jpg(工作正常,_001.jpg .._ 005.jpg下载) http://host.com/HT11019.jpg(不起作用,只下载主图像)
不幸的OpenCart是utf8_bin,我的表格整理是无法搜索名称中带有重音的产品名称.我在谷歌搜索,发现校对必须是utf8_general_ci兼容重音和不区分大小写的搜索.
如果我在搜索查询中添加整理声明怎么办?
SELECT *
FROM `address`
COLLATE utf8_general_ci
LIMIT 0 , 30
Run Code Online (Sandbox Code Playgroud)
它有任何(坏)副作用吗?我是关于索引,性能的问题?还是完全安全的?
我如何识别不同行中的以下复选框,并单独选中/取消选中它们.
<input type="checkbox" value="F" name="eph-ds[2457][]">
<input type="checkbox" value="PR" name="eph-ds[2457][]">
<input type="checkbox" value="DPH" name="eph-ds[2457][]">
<input type="checkbox" value="F" name="eph-ds[2450][]">
<input type="checkbox" value="PR" name="eph-ds[2450][]">
<input type="checkbox" value="DPH" name="eph-ds[2450][]">
Run Code Online (Sandbox Code Playgroud)
其中[number]是dinamically创建的.
示例:如果选中"F",则取消选中"PR".如果选中"PR",则取消选中"F".如果选中"DPH",则取消选中全部.
$(":checkbox").change(function() {
var current = this.value;
if (current == "F") {
$(":checkbox[value=PR]").prop("checked", false);
}
if (current == "PR") {
$(":checkbox[value=F]").prop("checked", false);
}
if (current == "DPH") {
$(":checkbox[value=F]").prop("checked", false);
$(":checkbox[value=PR]").prop("checked", false);
}
});
Run Code Online (Sandbox Code Playgroud)
此代码正常,但如果我取消选中第二行中的复选框,则第一行中的复选框也将取消选中:

我有一个链接,当用户点击它,然后他得到一个PDF.在jQuery中,我创建一个POST ajax调用服务器来获取PDF.响应是PDF,具有正确的内容标题等,通常会导致浏览器打开Reader插件,或允许用户保存PDF.但就我而言,这是行不通的.有没有办法设置数据内容类型,或将内容类型设置为PDF?
我的ajax电话:
$('#sf_getpdf').click(function() {
$.ajax({ //create an ajax request to load_page.php
type: "POST",
url: "index.php?route=sale/order/superfaktura_getpdf&token=<?php echo $token; ?>",
data: 'invoice_id=<?php echo $invoice_id; ?>&sf_token=<?php echo $sf_token ?>', //with the page number as a parameter
dataType: "text", //expect html to be returned
success: function(msg){
if(parseInt(msg)!=0) //if no errors
{
document.write(msg)
}
}
});
});
Run Code Online (Sandbox Code Playgroud)
萤火虫,回复:

浏览器响应...

我已经尝试在服务器中设置内容类型,但没有成功:

编辑:执行此操作不需要Ajax.
<a id="adr_stitok" target="_blank" href="index.php?route=sale/order/superfaktura_getpdf&token=<?php echo $token; ?>&invoice_id=<?php echo $invoice_id; ?>&sf_token=<?php echo $sf_token ?>" >Download</a></td>
Run Code Online (Sandbox Code Playgroud)
会做的事情.
我的商店有价格,包括20%的税.问题在于订单总数,让我解释一下.
OpenCart中的默认视图(运费为3欧元,含税):
Product X ........................1,50 EUR
------------------------------------------
Shipping ........................2,50 EUR
Subtotal without tax..............1,25 EUR
TAX 20%...........................0,75 EUR
Total (incl Tax)..................4,50 EUR
Run Code Online (Sandbox Code Playgroud)
问题是:
预期结果:
Product X ........................1,50 EUR
------------------------------------------
Shipping ...........................3 EUR
Subtotal without tax..............3,75 EUR
TAX 20%...........................0,75 EUR
Total (incl Tax)..................4,50 EUR
Run Code Online (Sandbox Code Playgroud)
有没有办法显示我显示的订单总数?
我正在尝试从 Opencart 发送带有附件的 HTML 电子邮件。有一个内置函数$mail->addAttachment。一切都很好,除了 Apple Mail 中附件的位置有一个白框。在 iOS 邮件应用程序中,附件根本不显示。在 GMail 上没问题:
该附件在 Apple Mail 中也可用,因为如果我双击白色区域,附件就会打开。
这是消息的来源,在 GMail 中打开(我删除了 X 标头):
X-Mailer: PHP/5.4.39-0+deb7u2
Content-Type: multipart/related; boundary="----=_NextPart_fefb9509ef8523a96a17066ecf8472c8"
------=_NextPart_fefb9509ef8523a96a17066ecf8472c8
Content-Type: multipart/alternative; boundary="----=_NextPart_fefb9509ef8523a96a17066ecf8472c8_alt"
------=_NextPart_fefb9509ef8523a96a17066ecf8472c8_alt
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Some text (text/plain)
------=_NextPart_fefb9509ef8523a96a17066ecf8472c8_alt
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test title</title>
</head>
<body>
<p>Some html text(text/html)</p>
</body>
</html>
------=_NextPart_fefb9509ef8523a96a17066ecf8472c8_alt--
------=_NextPart_fefb9509ef8523a96a17066ecf8472c8
Content-Type: application/pdf; name="form.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="form.pdf"
Content-ID …Run Code Online (Sandbox Code Playgroud) 我有一个日期变量(来自外部源):
var date = '28/04/2017';
var time = '19:28';
Run Code Online (Sandbox Code Playgroud)
可以使用moment.js(或不带?)将这些变量格式化为variout格式?
例如:04.28 19:28,2017.04.28 19:28或者甚至是19:28的今天(有片刻().calendar();)
我试过了
moment(date+' '+time).format('MM.DD.YYYY');
Run Code Online (Sandbox Code Playgroud)
...但我收到"无效日期"错误.
html ×3
jquery ×3
php ×3
javascript ×2
opencart ×2
ajax ×1
bash ×1
collation ×1
email ×1
gitlab ×1
gnu-parallel ×1
mime-types ×1
momentjs ×1
mysql ×1
wget ×1