locked
Invoking a toast notification should redirect to particular html page?

    Question

  • Hi,

      The following code I tried and when I clicked the toast notification it was not redirecting to the particular page(for example:bing.com ).how to make  toast capable of listening to the click event....help me..

    (function() {

    "use strict";

    importScripts(

    "//Microsoft.WinJS.1.0.RC/js/base.js");

    varbackgroundTaskInstance = Windows.UI.WebUI.WebUIBackgroundTaskInstance.current;

    varnotification = Windows.UI.Notifications;

     

    vartoastContent = NotificationsExtensions.ToastContent;

    varnotificationManager = notification.ToastNotificationManager;

    vartitle = "";

        WinJS.xhr({ type:

    "Get", url: http://www.abc.com }).done(function(res) {

    varnotificationData = JSON.parse(res.responseText);

            title = notificationData.title;

    varcontent = toastContent.ToastContentFactory.createToastText01();

        content.textBodyWrap.text = title;

    vartoast = content.createNotification();

    toast.addEventListener("click",myHandler);

        notificationManager.createToastNotifier().show(toast);

        }

        );})();

    function myHandler()

    {

    window.location.href=https://www.bing.com;

    }

       


    • Edited by sandbha Friday, July 20, 2012 1:12 PM
    Friday, July 20, 2012 1:10 PM

Answers