I write a script to display the message. File notify.js :
;(function(){ function Notify(titleText, messageText) { var notify = document.createElement("div"); notify.className = "notify"; var title = document.createElement("div"); title.className = "notify title"; title.innerHTML = titleText; var message = document.createElement("div"); message.className = "notify message"; message.innerHTML = messageText; notify.appendChild(title); notify.appendChild(message); function show(){ document.body.appendChild(notify); } } })(); When you connect the script in index.html and when you call Notify("title","message").show() error Notify is not defined and this is understandable, but how to write differently so that there are no conflicts with local scripts? I make a lot of mistakes, tell me which ones? How to organize the code, write the library?