Google Spreadsheets redirect

浪子不回头ぞ 提交于 2019-12-13 02:49:52

问题


Is it possible to redirect a URL in Google Spreadsheets script editor? I tried this, but it redirects before script is finished:

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
   $(function() 
      {$("#myiframe").load(window.location.replace('https://www.yahoo.es');});
</script>
<iframe src="https://docs.google.com/a/ageinfo.es/spreadsheets/d/ID" width="760"
     height="700" frameborder="0" marginheight="0" marginwidth="0">
   Loading...
</iframe>

Thanks


回答1:


I think that google uses a protection like this to prevent the use of spreedsheet in an iframe

if ( window.top !== window.self )
{
    window.top.location=window.self.location;
}

What is this ?

$(function() 
{
   $("#myiframe").load(window.location.replace('https://www.yahoo.es');
})


来源:https://stackoverflow.com/questions/23681514/google-spreadsheets-redirect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!