我想重定向到我以前的网址。
我使用了这个Net::SSH.start(@config.host, @config.user, :port => @config.port, :keys => @config.key, :config => true) do |session|
session.open_channel do |channel|
channel.request_pty
channel.send_channel_request "shell" do |ch, success|
if success
ch.send_data "env\n"
ch.send_data "#{command}\n"
ch.on_data do |c, data|
puts data
end
end
channel.send_data "exit\n"
channel.on_close do
puts "shell closed"
end
end
end
end
但它不起作用它给了我这个错误:
<meta http-equiv="refresh" content="2; url=javascript:history.back();">
第14行是redirectrequireditems.html:14 Refused to refresh http://localhost/Test.com/redirectrequireditems.html to a javascript: URL
有什么建议吗?
答案 0 :(得分:1)
不知道我们是否可以通过META标签来实现,我使用JavaScript有以下解决方案:
<script language="JavaScript" type="text/javascript">
setTimeout("window.history.go(-1)",2000);
</script>