问题
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