在Windows 7上使用Chrome版本43时,我能够重定向到另一个页面,但当我更新到Chrome 46时,重定向停止了工作。有什么想法吗?
HTML:
<button onclick=" uploadForm()">Upload</button>`
使用Javascript:
function uploadForm()
{
var portalId = getQueryString("portalId", "none");
var url= 'someWebPage?portalId=' + portalId;
try {
sforce.apex.execute("someController", "uploadForm", {portalId: portalId});
window.location.href = url;
}
catch (err) {
alert("Error: "+err.message);
}
}
答案 0 :(得分:0)
我强烈怀疑代码中的逻辑已被破坏。
我replicated your code(减去查询字符串解析),它完美无缺。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script>
function uploadForm()
{
var url= 'https://paul.kinlan.me';
try {
window.location.href = url;
}
catch (err) {
alert("Error: "+err.message);
}
}
</script>
</head>
<body>
<button onclick=" uploadForm();">Click Me</button>
</body>
</html>