"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Saturday, February 2, 2013

Javascript extension method with parameter

Extension method in JavaScript (http://simplyasp.blogspot.in/2013/01/extension-method-in-javascript.html) my previous post today extension  method with parameter.




<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function airthmaticOperation() {
        }
        airthmaticOperation.prototype.Addition = function (a, b) {
            return a + b;
        }
        airthmaticOperation.prototype.multiple = function (a, b) {
            return a * b;
        }
        var obj = new airthmaticOperation();
        document.write("Addition between 3 and 4 is :: " + obj.Addition(3, 4));
        document.write("</br>");
        document.write("multiple between 3 and 4 is :: " + obj.multiple(3, 4));
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    </div>
    </form>
</body>
</html>



If u had any trouble just ask, Happy to help u :)
Stay Tune... Have a nice day... 'N happy Coding :)

No comments: