0

大家早,

我正在修复网站中的错误并使用灯箱参数转义 URL 被证明是一项艰巨的任务......已经尝试了所有但似乎无法抓住这个......

W3 验证器给了我这个(验证器感知 &、[ 和 ] 字符):

 Error Line 130, Column 222: Bad value processa-watermark.php?id=TDJodmJXVXZhbUp0TDNCMVlteHBZMTlvZEcxc0wybHRZV2RsY3k5amIyNTBaWFZrYjNNdlNHVnlZbUZ5YVc4d015NXFjR2M9&lightbox[iframe]=true&lightbox[force]=image for attribute href on element a: Illegal character in query component.

 …e&amp;lightbox&lsqb;force&rsqb;=image"><img src="processa-imagem.php?src=TDJod…

  Syntax of IRI reference:
Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20. 

但是在我的代码中,我已经逃脱了这些字符:

<div class="imagem imagemEsq">
<a class="lightbox" href="processa-watermark.php?id=TDJodmJXVXZhbUp0TDNCMVlteHBZMTlvZEcxc0wybHRZV2RsY3k5amIyNTBaWFZrYjNNdlNHVnlZbUZ5YVc4d01pNXFjR2M9&amp;lightbox&lsqb;iframe&rsqb;=true&amp;lightbox&lsqb;force&rsqb;=image"><img src="processa-imagem.php?src=TDJodmJXVXZhbUp0TDNCMVlteHBZMTlvZEcxc0wybHRZV2RsY3k5amIyNTBaWFZrYjNNdlNHVnlZbUZ5YVc4d01pNXFjR2M9&amp;zc=1&amp;w=350&amp;q=90" width="350" height="263" alt="Arquivos do Herbário" /></a>
</div>

问题也很可能出在这段代码中(这是另一张图片)

<div class="imagem imagemDir">
<a class="lightbox" href="processa-watermark.php?id=TDJodmJXVXZhbUp0TDNCMVlteHBZMTlvZEcxc0wybHRZV2RsY3k5amIyNTBaWFZrYjNNdlNHVnlZbUZ5YVc4d015NXFjR2M9&amp;lightbox&lsqb;iframe&rsqb;=true&amp;lightbox&lsqb;force&rsqb;=image"><img src="processa-imagem.php?src=TDJodmJXVXZhbUp0TDNCMVlteHBZMTlvZEcxc0wybHRZV2RsY3k5amIyNTBaWFZrYjNNdlNHVnlZbUZ5YVc4d015NXFjR2M9&amp;zc=1&amp;w=250&amp;q=90" width="250" height="333" alt="Um livro de registos do Herbário" /></a>
</div>

谁能启发我:/

提前致谢!

4

1 回答 1

2

它应该是:

<div class="imagem imagemDir">
<a class="lightbox" href="processa-watermark.php?id=TDJodmJXVXZhbUp0TDNCMVlteHBZMTlvZEcxc0wybHRZV2RsY3k5amIyNTBaWFZrYjNNdlNHVnlZbUZ5YVc4d015NXFjR2M9&amp;lightbox%5Biframe%5D=true&amp;lightbox%5Bforce%5D=image" width="250" height="333" alt="Um livro de registos do Herbário" /></a>
</div>

参考: http: //www.blooberry.com/indexdot/html/topics/urlencoding.htm

于 2012-10-04T11:47:49.987 回答