JScript

Programação & Desenvolvimento


Você não está conectado. Conecte-se ou registre-se

Notificações HTML5

3 participantes

Ir para baixo  Mensagem [Página 1 de 1]

1Notificações HTML5 Empty Notificações HTML5 Ter 10 Mar 2015, 1:56 pm

joelson0007

joelson0007
Moderadores
Moderadores

Maneira simples de notificações HTML5 na forumeiros

Código:

function notify(sTitle,sContent,sImage,sUrl) {
    Notification.requestPermission(function() {
        var notification = new Notification(sTitle, {
            icon: sImage,
            body: sContent
        });
        if(sUrl)notification.onclick = function() {top.location.href=sUrl}
    });



usando a função

Código:

 document.addEventListener("DOMContentLoaded", function() {
    notify('Titulo','Conteudo','http://www.iconesbr.net/iconesbr/2008/12/7326/7326_256x256.png','http://jscript.forumeiros.com/')
  });

Até a próxima!

2Notificações HTML5 Empty Re: Notificações HTML5 Ter 10 Mar 2015, 3:01 pm

JScript

JScript
Administradores
Administradores

Testando aqui...

JS

http://autoitbrasil.com

3Notificações HTML5 Empty Re: Notificações HTML5 Qua 11 Mar 2015, 6:11 pm

waghcwb

waghcwb
Desenvolvedores
Desenvolvedores

Muito útil para aplicativos que funcionem em tempo real!! Da para usar na Forumeiros, para notificar de MP's e tal...

http://wagneraugusto.com.br/

Conteúdo patrocinado



Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos