如何在html页面上使用Jquery从类调用方法? [英] How to call a method from class using Jquery on html page?

查看:242
本文介绍了如何在html页面上使用Jquery从类调用方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html页面,我想使用jquery从类调用方法。

请注意,页面后面没有代码,它是一个html页面,方法需要是从类中调用。

I have a html page and i want to call method from a class using jquery.
Please note it down that there is no code behind page, its an html page and the method need to be called from class.

推荐答案

您将使用jQuery .ajax方法: http://api.jquery.com/jQuery.ajax/ [ ^ ]
You would use the jQuery .ajax method: http://api.jquery.com/jQuery.ajax/[^]


是的,您需要使用ajax调用才能使其正常工作。因此,如果这是独立的类库,则需要从中创建asp处理程序或Web服务,以便可以对处理程序/ Web服务进行ajax调用,而后者又将与类 - 方法进行对话。
Yes, you need to ajax call to make that work. So if that is independent class library, you need to create asp handler or web service out of that , so that ajax call can be made to handler / web service , which in turn will talk to class - method.


你需要使用Web方法.....

检查这个..



You need to use Web Method for this.....
check this..

<script type="text/javascript">
function ShowCurrentTime() {


这篇关于如何在html页面上使用Jquery从类调用方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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