Javascript HTML/CSS/JS切换不同的谷歌日历是同一个框架

Javascript HTML/CSS/JS切换不同的谷歌日历是同一个框架,javascript,html,css,dynamic,calendar,Javascript,Html,Css,Dynamic,Calendar,我有多个谷歌日历,我想在一个框架内将它们显示在网站上。通勤电话应动态更改。如果可能的话,一定要告诉我。我在下面提供了示例代码 <a href="<iframe src="https://calendar.google.com/calendar/embed?src" class="btn btn-default" >Calendery_1 </a> <a href="<iframe src="https://calendar.google.com/cale

我有多个谷歌日历,我想在一个框架内将它们显示在网站上。通勤电话应动态更改。如果可能的话,一定要告诉我。我在下面提供了示例代码

<a href="<iframe src="https://calendar.google.com/calendar/embed?src" class="btn btn-default" >Calendery_1 </a>
<a href="<iframe src="https://calendar.google.com/calendar/embed?src" class="btn btn-default" >Calendery_2 </a>
<a href="<iframe src="https://calendar.google.com/calendar/embed?src" class="btn btn-default" >Calendery_3 </a>
<a href="<iframe src="https://calendar.google.com/calendar/embed?src" class="btn btn-default" >Calendery_4 </a>

src元素的更改可以通过3种不同的方式完成——使用普通HTML、简单JavaScript或jQuery。这取决于你的要求,选择哪一个。下面是一个简单的HTML响应。我尝试了以下两种解决方案,效果很好

HTML方法

   <p>Click on link bellow to change iframe content:</p>
         <a href="https://calendar.google.com/calendar/embed?src=81fmklm3e8fmar82p72jc89ld4%40group.calendar.google.com&ctz=Asia/Calcutta" target="search_iframe">TechMocktail</a> -
        <a href="https://calendar.google.com/calendar/embed?src=cl5g5tm0fuj0ras7jr5bk29khs%40group.calendar.google.com&ctz=Asia/Calcutta" target="search_iframe">TechMocktail Course</a> 

        <iframe src="http://en.wikipedia.org" style="border: 0" width="100%" height="300" frameborder="0" scrolling="no" name="search_iframe"></iframe>
function go(loc) {
            document.getElementById('calendar').src = loc;
        }

<iframe id="calendar" src="about:blank" width="1000" height="450" frameborder="0" scrolling="no"></iframe>

    <form method="post">
        <input name="calendarSelection" type="button" Value=" Calendar1" onclick="go('https://calendar.google.com/calendar/embed?src=81fmklm3e8fmar82p72jc89ld4%40group.calendar.google.com&ctz=Asia/Calcutta')" />
        <input name="calendarSelection" type="button" value=" Calendar2" onclick="go('https://calendar.google.com/calendar/embed?src=cl5g5tm0fuj0ras7jr5bk29khs%40group.calendar.google.com&ctz=Asia/Calcutta')" />
        <input name="calendarSelection" type="button" value=" Wikipedia"  onclick="go('http://en.wikipedia.org')" />
    </form>
单击下面的链接以更改iframe内容:

-
我创建了两个谷歌日历,并尝试了上面的例子。一定要让我知道这是否有帮助,或者你需要更多的细节

JavaScript方法

   <p>Click on link bellow to change iframe content:</p>
         <a href="https://calendar.google.com/calendar/embed?src=81fmklm3e8fmar82p72jc89ld4%40group.calendar.google.com&ctz=Asia/Calcutta" target="search_iframe">TechMocktail</a> -
        <a href="https://calendar.google.com/calendar/embed?src=cl5g5tm0fuj0ras7jr5bk29khs%40group.calendar.google.com&ctz=Asia/Calcutta" target="search_iframe">TechMocktail Course</a> 

        <iframe src="http://en.wikipedia.org" style="border: 0" width="100%" height="300" frameborder="0" scrolling="no" name="search_iframe"></iframe>
function go(loc) {
            document.getElementById('calendar').src = loc;
        }

<iframe id="calendar" src="about:blank" width="1000" height="450" frameborder="0" scrolling="no"></iframe>

    <form method="post">
        <input name="calendarSelection" type="button" Value=" Calendar1" onclick="go('https://calendar.google.com/calendar/embed?src=81fmklm3e8fmar82p72jc89ld4%40group.calendar.google.com&ctz=Asia/Calcutta')" />
        <input name="calendarSelection" type="button" value=" Calendar2" onclick="go('https://calendar.google.com/calendar/embed?src=cl5g5tm0fuj0ras7jr5bk29khs%40group.calendar.google.com&ctz=Asia/Calcutta')" />
        <input name="calendarSelection" type="button" value=" Wikipedia"  onclick="go('http://en.wikipedia.org')" />
    </form>
功能go(loc){
document.getElementById('calendar')。src=loc;
}

src元素的更改可以通过3种不同的方式完成——使用普通HTML、简单JavaScript或jQuery。这取决于你的要求,选择哪一个。下面是一个简单的HTML响应。我尝试了以下两种解决方案,效果很好

HTML方法

   <p>Click on link bellow to change iframe content:</p>
         <a href="https://calendar.google.com/calendar/embed?src=81fmklm3e8fmar82p72jc89ld4%40group.calendar.google.com&ctz=Asia/Calcutta" target="search_iframe">TechMocktail</a> -
        <a href="https://calendar.google.com/calendar/embed?src=cl5g5tm0fuj0ras7jr5bk29khs%40group.calendar.google.com&ctz=Asia/Calcutta" target="search_iframe">TechMocktail Course</a> 

        <iframe src="http://en.wikipedia.org" style="border: 0" width="100%" height="300" frameborder="0" scrolling="no" name="search_iframe"></iframe>
function go(loc) {
            document.getElementById('calendar').src = loc;
        }

<iframe id="calendar" src="about:blank" width="1000" height="450" frameborder="0" scrolling="no"></iframe>

    <form method="post">
        <input name="calendarSelection" type="button" Value=" Calendar1" onclick="go('https://calendar.google.com/calendar/embed?src=81fmklm3e8fmar82p72jc89ld4%40group.calendar.google.com&ctz=Asia/Calcutta')" />
        <input name="calendarSelection" type="button" value=" Calendar2" onclick="go('https://calendar.google.com/calendar/embed?src=cl5g5tm0fuj0ras7jr5bk29khs%40group.calendar.google.com&ctz=Asia/Calcutta')" />
        <input name="calendarSelection" type="button" value=" Wikipedia"  onclick="go('http://en.wikipedia.org')" />
    </form>
单击下面的链接以更改iframe内容:

-
我创建了两个谷歌日历,并尝试了上面的例子。一定要让我知道这是否有帮助,或者你需要更多的细节

JavaScript方法

   <p>Click on link bellow to change iframe content:</p>
         <a href="https://calendar.google.com/calendar/embed?src=81fmklm3e8fmar82p72jc89ld4%40group.calendar.google.com&ctz=Asia/Calcutta" target="search_iframe">TechMocktail</a> -
        <a href="https://calendar.google.com/calendar/embed?src=cl5g5tm0fuj0ras7jr5bk29khs%40group.calendar.google.com&ctz=Asia/Calcutta" target="search_iframe">TechMocktail Course</a> 

        <iframe src="http://en.wikipedia.org" style="border: 0" width="100%" height="300" frameborder="0" scrolling="no" name="search_iframe"></iframe>
function go(loc) {
            document.getElementById('calendar').src = loc;
        }

<iframe id="calendar" src="about:blank" width="1000" height="450" frameborder="0" scrolling="no"></iframe>

    <form method="post">
        <input name="calendarSelection" type="button" Value=" Calendar1" onclick="go('https://calendar.google.com/calendar/embed?src=81fmklm3e8fmar82p72jc89ld4%40group.calendar.google.com&ctz=Asia/Calcutta')" />
        <input name="calendarSelection" type="button" value=" Calendar2" onclick="go('https://calendar.google.com/calendar/embed?src=cl5g5tm0fuj0ras7jr5bk29khs%40group.calendar.google.com&ctz=Asia/Calcutta')" />
        <input name="calendarSelection" type="button" value=" Wikipedia"  onclick="go('http://en.wikipedia.org')" />
    </form>
功能go(loc){
document.getElementById('calendar')。src=loc;
}

一定要让我知道您希望通过使用上述代码实现什么-多个日历的目的以及在一个框架内使用它们的原因,以便尝试帮助您我认为“在同一框架内”。在我的网站上,我想公布学校每间教室的占用情况。为了更清楚,我为每个房间准备了单独的日历。Google Calendar提供了一个可以插入页面的链接,但是它不能通过在同一个框架中抛出日历来切换链接。感谢前面的更正。要求很明确,这确实有助于提供解决方案。将回复ASAPDo让我知道您希望通过使用上述代码实现什么-多个日历的目的以及在一个框架内使用它们的原因,以便尝试帮助您我认为“在同一框架内”。在我的网站上,我想公布学校每间教室的占用情况。为了更清楚,我为每个房间准备了单独的日历。Google Calendar提供了一个可以插入页面的链接,但是它不能通过在同一个框架中抛出日历来切换链接。感谢前面的更正。要求很明确,这确实有助于提供解决方案。我会尽快回复,非常感谢你。这正是我们需要的。非常感谢。这正是我们所需要的。