2016-07-13 7 views
-2

invoice Ich muss diesen Js-Code verwenden, und ich bin nicht in der Lage, es zu verstehen, und wie man es benutzt.wie var Funktion

var ctrlStageAsocDocumentsEvent = (function() 
{ 
    var module = {}; 
    var self = module; 

    module.openPopup = function(configDoc) 
    { 
     var timestamp = (new Date).getTime(); 

     popupC = window.open('www.google.es','', 'titlebar=no,toolbar=no,location=no,status=no,menubar=no,resizable=no, top=0, left=0, type=fullWindow,fullscreen,scrollbars=yes'); 
    }; 


    module.init = function(param) 
    { 
     alert("hello"); 

    }; 

    return { 
     init: module.init 
    }; 
})(); 

Von Chrome Konsole habe ich versucht ctrlStageAsocDocumentsEvent und es hat nur init, wie kann ich auf openpopup zugreifen?

soll ich ctrlStageAsocDocumentsEvent.openPopup(); aber das funktioniert nicht

+0

P. S. Invoque === aufrufen – evolutionxbox

Antwort

2

eine öffentliche Variable erstellen wie:

return { 
    init: module.init, 
    openPopup: module.openPopup 
}; 

und dann können Sie es mögen Zugang:

ctrlStageAsocDocumentsEvent.openPopup(); 
Verwandte Themen