掩蔽和放大器;放大器;对于AJAX请求 [英] Masking & for AJAX requests

查看:166
本文介绍了掩蔽和放大器;放大器;对于AJAX请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个后续的问题,我问了几个星期了。

This is a follow-up to a question I asked a few weeks back.

以下内容:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test</title>
</head>
<body>
<a onclick="start_ajax_request('url.php&key1=val1&key2=val2&key3=val3')">Test</a>
</body>
</html>

不可以验证在W3C验证为HTML 4.01过渡,错误,据我所看到的。它抱怨实体,并希望每一个符号转换成&放大器;放大器; &放大器;放大器; 在给定的情况下但是,这是错误的,因为我的Ajax请求需要简单的&符号,将打破反馈时的&放大器;放大器;

will not validate in the W3C validator as HTML 4.01 transitional, wrongly, as far as I can see. It complains about entities and wants each ampersand converted to &amp;. &amp; in the given context however, would be wrong, because my Ajax request needs plain ampersands and will break when fed &amp;.

有没有办法来掩盖/逃离这个例子中的&符号,这样它仍然会通过Ajax请求有效的URL,并关闭了验证?

Is there a way to mask/escape the ampersands in this example so that it's still a valid URL that will pass through the Ajax request, and shuts up the validator?

推荐答案

试着使用JS escape()函数,并通过传递符号为%26同样的方式传递,我相信你看到的空间通过为%20

Try passing with the JS escape() function and by passing the ampersand as %26 The same way I am sure you see spaces passed as %20

希望工程

这篇关于掩蔽和放大器;放大器;对于AJAX请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆