javascript - encodeURIComponent() 在 IE-11-Js/ReactJs 中不起作用
问题描述
我想使用如下上下文历史记录点击报告时访问 url:
function onClick() {
let name = encodeURIComponent(title); // title is string- ex: "abc", "test", "user123"
this.context.history.push({
pathname: `/report?name="${name}"`
});
}
这在 Chrome,FF 中运行良好,但在 IE 上给出 404。知道如何解决这个问题吗?
解决方案
推荐阅读
- python - Pandas dataframe: Grouping columns having the same first characters
- r - 删除重复项,以列中的值为条件
- javascript - 错误:
属性 x:预期长度,“NaN” - angular - 如何从组件交互中访问元素?
- node.js - gulp 包任务 -ReferenceError: primordials 未定义
- angular - 如何在 Fuse Angular 日历中使用自定义模板?
- python - 如何使用 Python 检测图形的转折点
- android - 手机的键盘隐藏了我的底页对话框片段。我该如何解决这个问题?
- javascript - IE11 无法识别 vendor.js 中的 rest 参数
- c - 如何使用 C 语言遍历 ARM AT91SAM7S256 微控制器中的 LED 列表