如何在JavaScript页面中调用函数背后的代码 [英] How do i call code behind function into javascript page

查看:58
本文介绍了如何在JavaScript页面中调用函数背后的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个abc()函数,该函数返回hello,如何在javascript页面上调用它.

i make a abc() function that return hello, how i call it on javascript page.

推荐答案

我们真的相信两个用户问的是确切的吗彼此之间在几秒钟内就遇到了同样的问题?
Are we really to believe that two users asked the exact same question within seconds of each other ?


您必须进行回发,并在委托中调用方法abc().
要在javascript中进行回发,可以使用GetPostBackEventReference.

或使用
You must do a postback and in the delegate call you method abc().
For make a postback in javascript you can use GetPostBackEventReference.

Or use Ajax callbacks to Web Methods




试试这个

Hi,

try this

function doClick(e){
               //the purpose of this function is to allow the enter key to
               //point to the correct button to click.
       var key;
        if(window.event)
             key = window.event.keyCode;     //IE
        else
             key = e.which;     //firefox

           if (key == 13)
           {
               //Get the button the user wants to have clicked
               var btn = document.getElementById("ctl00_ContentPlaceHolder1_btnSearch");
               if (btn != null)
               { //If we find the button click it
                   btn.click();
                   event.keyCode = 0
               }
           }
       }


这篇关于如何在JavaScript页面中调用函数背后的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆