javascript $f 在 jquery 脚本中是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14819910/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What doen $f mean in jquery scripts?
提问by Marc
I see the function $f being used in a number of jquery related scripts, but I can't find a description of what this means anywhere.
我看到许多与 jquery 相关的脚本中都使用了 $f 函数,但是我在任何地方都找不到这意味着什么的描述。
Example
例子
var iframe = document.getElementById(iframe_id);
this.player = global.$f(iframe);
Can anyone point me to documentation?
谁能指出我的文档?
回答by Marc
Apparently, f$
is associated with froogaloop, which is...
显然,f$
与froogaloop相关联,这是...
(...) a small Javascript utility framework to help with the complexities involved in dealing with using the Javascript API through window.postMessage for controlling Vimeo's Moogaloop video player.
(...) 一个小型 Javascript 实用程序框架,可帮助解决通过 window.postMessage 使用 Javascript API 来控制 Vimeo 的 Moogaloop 视频播放器所涉及的复杂性。
回答by Zevi Sternlicht
$F
is originally a function from prototype.js, returning the value of the requested form element:
$F
最初是一个来自prototype.js的函数,返回请求的表单元素的值:
var $F = Form.Element.Methods.getValue;
From the related Wikipedia article:
The $F() function- Building on the $() function: the $F() function returns the value of the requested form element. For a 'text' input, the function will return the data contained in the element. For a 'select' input element, the function will return the currently selected value.
$F() 函数- 建立在 $() 函数之上:$F() 函数返回请求的表单元素的值。对于“文本”输入,该函数将返回元素中包含的数据。对于“选择”输入元素,该函数将返回当前选定的值。
It appears that plugin scripters have written a version for jQuery as well. See this link here.
插件脚本编写者似乎也为 jQuery 编写了一个版本。请在此处查看此链接。
The flash video player Flowplayer also has a function $f
that is a shortcut for flowplayer()
.
Flash 视频播放器 Flowplayer也有一个功能$f
,它是flowplayer()
.