none
How to reuse functions in a javascript file (file.js) ? RRS feed

  • Question

  • I have a JavaScript file vbulletin_md5.js

    var hexcase=0;
    var b64pad="";
    var chrsz=8;

    function hex_md5(A){return binl2hex(core_md5(str2binl(A),A.length*chrsz))}
    function b64_md5(A){return binl2b64(core_md5(str2binl(A),A.length*chrsz))}
    ...

    many other relate functions here
    ...

    function md5hash(B,A,E,C)
    {
        if(      navigator.userAgent.indexOf("Mozilla/")==0
            &&   parseInt(navigator.appVersion)>=4          )
        {    var D=hex_md5(str_to_ent(trim(B.value)));
            A.value=D;
            if(E)
            {    D=hex_md5(trim(B.value));
                E.value=D}
                if(!C)
                {   
                    B.value=""                       
                }
        }
            return true
    };

    I want to reuse the function md5hash without recoding it and relate functiona in C# (not ASP)

    How to do?

     

    • Moved by Harry Zhu Wednesday, July 28, 2010 3:59 AM (From:JScript for the .NET Framework)
    Monday, July 26, 2010 8:31 AM

All replies

  • Hi,

    For the
    questions relating to asp.net ,please post to: http://forums.asp.net/.

    Thanks,
    Harry


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, July 28, 2010 3:58 AM