# How to leaveMeeting by an external button

**URL:** <https://devforum.zoom.us/t/how-to-leavemeeting-by-an-external-button/27540>\
**Category:** Web\
**Created:** [August 18, 2020, 11:11pm UTC](https://devforum.zoom.us/t/how-to-leavemeeting-by-an-external-button/27540 "2020-08-18T23:11:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom3](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tom3/32/16383_2.png) [@tom3](https://devforum.zoom.us/u/tom3)\
**Post date:** [August 18, 2020, 11:11pm UTC](https://devforum.zoom.us/t/how-to-leavemeeting-by-an-external-button/27540/1 "2020-08-18T23:11:40Z")

</div>

We are adding an external html button to leave the meeting. We are able to init and join a meeting fine, however we want to be able to run sdk functions to interact with the meeting from custom buttons. The main one is to allow user to leave the meeting with a custom button located outside the meeting iframe. The javascript function is:

function leave()  
{

ZoomMtg.leaveMeeting({  
leaveUrl: ‘/index.html’,  
success: function(response) {  
console.log(response);  
},  
error: function (err) {  
console.log(err);  
}  
});  
}

We are geting the following error:  
errorCode: 3008  
errorMessage: “ **Please init meeting first!** ”  
method: “leaveMeeting”  
result: null  
status: false

We are using the CDN files Version 1.7.10

This issue is happening in all browsers and also in many other ZoomMgt functions.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 19, 2020, 8:15pm UTC](https://devforum.zoom.us/t/how-to-leavemeeting-by-an-external-button/27540/2 "2020-08-19T20:15:21Z")

</div>

Hey @tom3,

You will need to have the leave meeting function be called within the same scope as where you are initing and joining the Web SDK.

If you share your code snippets I can help.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tom3](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tom3/32/16383_2.png) [@tom3](https://devforum.zoom.us/u/tom3)\
**Post date:** [August 20, 2020, 12:08am UTC](https://devforum.zoom.us/t/how-to-leavemeeting-by-an-external-button/27540/3 "2020-08-20T00:08:00Z")

</div>

Hi Tommy:

Thanks for your answer, we will do that.

Regards,

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 20, 2020, 5:20pm UTC](https://devforum.zoom.us/t/how-to-leavemeeting-by-an-external-button/27540/4 "2020-08-20T17:20:01Z")

</div>

You are welcome! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [September 20, 2020, 3:20am UTC](https://devforum.zoom.us/t/how-to-leavemeeting-by-an-external-button/27540/5 "2020-09-20T03:20:18Z")

</div>

Closed on September 20, 2020, 3:20am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
