在JQuery插件中调用Javascript函数 [英] Calling Javascript function inside JQuery plugin

查看:76
本文介绍了在JQuery插件中调用Javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,我只是想知道是否可以在JQuery插件中调用javascript函数?如果满足某个条件,我想在我的jquery文件中调用一个函数。



Hey guys, I am just wondering if it is possible to call a javascript function inside a JQuery plugin? I want to call a function inside my jquery file if a certain condition is met.

var displayMessage = function (objNotification) {

              this.hello = function () {
                   alert('Condition met!');
               }

               var json = JSON.parse(objNotification);
//this is where I call my plugin where I pass a JSON object. I want to call the function hello in here?
               notification(json);
           };









先谢谢你们。





Thanks in advance guys.

推荐答案

是的,这是可能的,甚至不是问题。要调用的函数应该在(按时间顺序,而不是按照代码文本的顺序)调用之前创建为函数对象,这就是全部。这是脚本,在这方面非常放松。



只需拨打电话;你在等什么,我的同意? :-)



-SA
Yes, this is possible and not even a problem. The function to be called should be created as a function object before (in time order, not in the order of the code text) calling, that''s all. This is scripting, very relaxed in this respect.

Just call it; what are you waiting for, my approval? :-)

—SA


这篇关于在JQuery插件中调用Javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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