---
schema_version: "1"
id: 422d744a458ddd3e18d688df9d6609d3e98eb213f0c66bf66c18a52b9d5ba586
title: Unsubscribing from Events in a Visualforce Page
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/canvas-framework/guides/platform-connect/using/resizing-in-vf/canvas-app-vf-unsubscribe-code-example.md
canonical_url: https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-vf-unsubscribe-code-example.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ea7256769474290bc8a1100750e9141ecbc049aa435f639f03d5bdd79b07334e
products:
  - Canvas Developer Guide
  - Platform Developer Content
---

# Unsubscribing from Events in a Visualforce Page

The following code example shows how to call the `unsubscribe` method within a Visualforce page to unsubscribe from two events.

<!-- otherprops: set_clipboard -->
```java
    Sfdc.canvas.controller.unsubscribe(['mynamespace.myevent2', 'mynamespace.myevent2']);

```

**See Also**  


-   [Using Events between a Visualforce Page and a Canvas App](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-vf-app-resizing.md)
-   [Publishing a Canvas Event from a Visualforce Page](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-vf-publish-code-example.md)
-   [Resizing a Canvas App in a Visualforce Page](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-vf-resize-code-example.md)
-   [Subscribing to Events](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-vf-subscribe-code-example.md)

