Skip to content

a simple html same domain communication by localStorage storage event

Notifications You must be signed in to change notification settings

FikaCode/js-sdc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

javascript same domain communication

a simple html same domain communication by localStorage storage event

require

storage event support
localstorage support

usage

  1. import script
    <script src="./js-sdc.js"></script>
  2. receive message
  onSDCMessage('test', function (mess) {
    alert(mess);
  });
  1. send Message

    same page

    sendSDCMessage("test", "same page mess!", true);
    

    not same page

    sendSDCMessage("test", "not same page mess!");
    

license

MIT License

About

a simple html same domain communication by localStorage storage event

Resources

Stars

Watchers

Forks