4 Ekim 2010 Pazartesi

create custom JavaScript method

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script language="javascript">
            var carpma=new Function("x", "y", "z","return x*y+z;");
            var sonuc=carpma(3,4,6);
            alert("New ile uretilen functionun degeri: "+sonuc);
            function degerToplama(a,b)
            {
                return a+b;
            }
            document.write("Toplama functionun degeri: "+Toplama(45,3));
        </script>
    </head>
    <body>
        
    </body>
</html>

Hiç yorum yok:

Yorum Gönder