Search This Blog

Friday, June 29, 2012

Defining a function call in javascript

Current project at work has me learning more Javascript.
Here is a simple example of defining a function call for a button in a separate script file.
The project is ASP.NET MCV3 project and the javascript files are incorporated in Site.Master file.

Simple function call in Javascript:

<script type="text/javascript" src="<%= Portal.UrlHelper.VirtualPath %>/Scripts/portal-about.js?ver=<%= Portal.VersionHelper.Version %>">script>

portal-about.js
(function() {

    Portal.about = function() {
    
    };

})();

Strange new world at least for me ;)

No comments: