Not yet rated

Problem

Often your application or web page requires the functionality to be able to open a new window, send e-mail, or trigger a JavaScript event. How can this be done?

Solution

This can be accomplished by tweaking the navigateToURL method to suit your particular use case.

Detailed explanation

Below are three simple code snippets that demonstrate how to employ the navigateToURL method for opening a new window, sending an email and interacting with JavaScript.

Opening a new window:

navigateToURL (new URLRequest ("http://blog.activetofocus.com"), "_blank");

Sending an email:

navigateToURL (new URLRequest ("mailto: blog@activetofocus.com"));

Interacting with JavaScript:

navigateToURL (new URLRequest ("javascript: window.close ()"));

Calling a JavaScript function:

navigateToURL (new URLRequest ("javascript: MyJsFun (par. ..)"));

This recipe was originally posted at: http://activetofocus.com/blog/navigatetourl-open-a-new-window-or-email-or-with-the-communication-between-js-6/


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes