嵌入在网页中的Google表格

问题描述 投票:1回答:1

我的网页中嵌入了Google工作表,希望能够点击同一页面上的链接并将其更改为其他电子表格。例如:

链接1(加载Google表单1) 链接2(加载Google表格2) 链接3(加载Google表格3)

当我点击链接1时,电子表格在我的网页中显示正常。我现在想要从链接1点击链接2清除Google表单1并在页面上的同一位置加载Google表格2。然后,链接3将在点击时加载Google表格3。

任何想法如何去做?

    $(document).ready(function(){
       $("#HD").click(function(){
        $('#result').load('https://docs.google.com/spreadsheets/d/e/2PACX-1vQzTUQh0_LJWxHRYiSeOpw1Qy5-TJ3mKPQVVC3kQzGh-6ZlCO0ujbRDH1jVowBYXP06x-3trgRji8Bc/pubhtml?widget=true&headers=false');

       }); 
<div class="row">
        <section class="6u">
        <ul class="default">
        <li><a id=HD href="#">Military Headstone Application</a></li>
</ul>

<div class="row">
  <section class="6u">
    <ul class="default">
      <iframe width=1400 height=900 src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQzTUQh0_LJWxHRYiSeOpw1Qy5-TJ3mKPQVVC3kQzGh-6ZlCO0ujbRDH1jVowBYXP06x-3trgRji8Bc/pubhtml?widget=true&amp;headers=false"></iframe>
        <div id="result" style="clear:both;">
html google-sheets embed spreadsheet dreamweaver
1个回答
3
投票

试试这个...它只使用HTML。

here的回答

<html>
<p>Click on links bellow to change iframe content:</p>
<a href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQzTUQh0_LJWxHRYiSeOpw1Qy5-TJ3mKPQVVC3kQzGh-6ZlCO0ujbRDH1jVowBYXP06x-3trgRji8Bc/pubhtml?widget=true&amp;headers=false" target="sheets_embed">Link 1</a> -
<a href="https://bing.com" target="sheets_embed">Link 2</a> -
<a href="https://en.wikipedia.org" target="sheets_embed">Link 3</a>

<iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQzTUQh0_LJWxHRYiSeOpw1Qy5-TJ3mKPQVVC3kQzGh-6ZlCO0ujbRDH1jVowBYXP06x-3trgRji8Bc/pubhtml?widget=true&amp;headers=false" width="100%" height="100%" name="sheets_embed"></iframe>
</html>

用不同的电子表格替换链接

© www.soinside.com 2019 - 2024. All rights reserved.