未定义编码 URI 组件
EncodeURIcomponent is not defined
我在GreaseMonkey沙盒中玩,试图制作一个脚本,将加载的页面转发到另一台服务器,以便通过POST进行处理。下面是脚本:
// ==UserScript==
// @name Mirror Page
// @namespace mailto:linkhyrule5@gmail.com
// @description POSTs page to dynamic page mirror
// @include http://*
// @include https://*
// @version 1
// @grant GM_xmlhttpRequest
// ==/UserScript==
var ihtml = document.body.innerHTML;
GM_xmlhttpRequest({
method: 'POST',
url: 'http://localhost:5723/index.php',
data: "PageContents=" + encodeURIcomponent(ihtml) + "'nURL=" + encodeURIcomponent(document.URL),
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
});
不知何故,我越来越encodeURIcomponent is not defined
,即使它是一个全局函数,应该在 JavaScript 所在的任何地方可用。我想我误解了什么?
你忘了大写字母C...就像骆驼案:
var ihtml = document.body.innerHTML;
GM_xmlhttpRequest({
method: 'POST',
url: 'http://localhost:5723/index.php',
data: "PageContents=" + encodeURIComponent(ihtml) + "'nURL=" + encodeURIComponent(document.URL),
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
});
相关文章:
- React重新渲染但未显示正确的组件
- 不能从angular2中的子组件指定父组件中的数组
- 拨打'父亲'函数形式a'儿童'ReactJS中的组件
- React组件等待所需道具进行渲染
- 如何创建带有插槽的vue js组件预加载程序
- KnockoutJS-组件-多个实例
- 如何更改reactjs中外部/独立组件的状态或属性
- 如何在react js中将值从一个组件发送到另一个组件
- React Native通过Navigator将用户输入数据传递到选项卡栏IOS中的组件
- React组件-设置页面标题
- 如何在Edge中下载图像/png数据URI
- PHP(PDO)url编码如何在javascript中解码?decodeURI?或解码URI组件
- 未定义编码 URI 组件
- 为什么在尝试在 javascript 中对 URI 组件的保留字符进行编码时出现空白 %3 字符
- 对 URI 组件非 utf-8 字符进行编码并相应地解码它们的正确方法是什么
- 如何将字符串转换为URI组件
- Javascript decodeURI(组件)格式错误的uri异常
- 编码 uri 组件,不自动解码
- 如何对uri组件进行编码
- 类似python的javascript中URI组件的递归解码