In jQuery, I have seen both the following ways of defining a jQuery function:
$.fn.CustomAlert = function() {
alert('boo!');
};
$.CustomAlert = function() {
alert('boo!');
};
I understand that they are attached to the jQuery object (or $), but what is the difference between the two? When should I use one or the other?
Thanks.
I want to format a date in jsf which is xmlgregoriancalendar type. I've come across post which say I need custom converter. Does anybody found solution which does not require custom date converter. I was trying following but I gives me error saying...
Element type "h:outputText" must be followed by either attribute specifications, "" or "/".
This…
In natty pressing Fn+F2 on my Samsung NC10 opened a new notification with the remaining battery power. After upgrading to Oneiric, it opens the power statistics. Is the a way to revert this change?
Checking the battery status with the notification is much faster than finding it from the power statistics. I know that the remaining battery time can…
I've got an Asus 4830T onto which I've just re-installed 12.04 because I installed an SSD. I was running 12.04 before too, which had been upgraded over a few releases. At some point on that old install, I had gotten all the "Fn" keys to work, or at least all the ones I cared about. (Oh except I think the screen brightness keys never worked.) I…
1. jQuery.expr[':'].aFilter =
function(elem, index, match){
return true; // Return true/false as per need
};
$('div.red').filter(':aFilter').doSomething();
i want pass some custom arguments to "jQuery.expr[':'].aFilter" function, is it possible to do it
I have an Excel worksheet in XML format which contains
<Cell ss:StyleID="s127"><Data ss:Type="String">A01-Replace</Data></Cell>
I want to replace @A01-Replace with a different string. I'm using the XQuery's replace function like so:
let $excel := doc("excel.xml")
let $test := "another string"
return…
$("p").bind("click", function(event){
// code goes here
});
This is quite understandable. But what is the way to use a non-inline function and pass the event as an argument? That is:
$("p").bind("click", myFunction(event));
function myFunction(event) {
// code goes here
}
Thank you!
I've got a ThinkPad W530 laptop, which replaces the Application Key (also known as Menu Key or Mouse Right Click key, usually between Right Alt and Right Ctrl) with the Print Screen key.
So, I need to replace Prt/Scr with Application key. That's easy, all key mapping software like SharpKeys or whatever can do that. There are…
I'm trying to write a scheme func that behaves in a way similar to a loop.
(loop min max func)
This loop should perform the func between the range min and max (integers)
-- one of an example like this
(loop 3 6 (lambda (x) (display (* x x)) (newline)))
9
16
25
36
and I define the function as
( define ( loop min max…
Examples of what you can do.
(defmethod some-fn ((num real)) (print "an integer"))
(defmethod some-fn ((num real)) (print "a real"))
(defmethod some-fn ((num (eql 0))) (print "zero"))
(some-fn 19323923198319)
"an integer"
(some-fn 19323923198319.3)
"a real"
(some-fn 0)
"zero"
It also works with a general 'string type.
…
On current Ubuntu (10.04) suspend-on-lid/Fn+F4 only works if some powermanagement-applet of KDE/gnome is running.
But what about suspend-to-lid if you are working on the console or using a non-bloated window-manager?
What is the current mechanism to configure suspend-on-lid system wide?
What of…
I recently bought a new Lenovo ThinkPad Edge E320. I'm having trouble with my Fn-Keys. The ones for Sound, Brightness and MUltimedia work but those that toggle Wifi/Bluetooth, Webcam and Microphone on and off won't. Fortunately the Wifi, Webcam and Mic are enabled by default. My problem is that I…
I am using the following functions to do my task. It works fine when cursor moves away from textbox but if i want to fire the same event from code say like next function i get error...
function addEvent( obj, type, fn ) {
if (obj.addEventListener) {
obj.addEventListener( type, fn, false );
…
Hi,
I was wondering how to access a global function fn in ruby from a class which also defined a method fn. I have made a workaround by aliasing the function like so:
def fn
end
class Bar
alias global_fn fn
def fn
# how to access the global fn here without the alias
…
i have made a text editor in C. when i am changing the extension of that file from .c to .sh and compiling the file in the terminal,some error is shown,like for the global variables an external error is shown,and for the functions i have declared errors are shown there also.please help me to…
I'm delving into writing plugins for jQuery and I'm trying to understand the distinction between $.f and $.fn.f
I've seen pluggin authors use both, or sometimes assign $.f = $.fn.f
Can someone explain this to me, reasoning, benefits, etc?
If you are looking for configure the iPlanet as Web server/proxy to use with
the Oracle WebCenter Content, you probably won’t found an specific documentation
for that or will found some old complex notes related to the old 10gR3.
This post will help you out with few simple steps.
…
I'm using Glassfish 3.2.2 and JSF 2.1.11
I'm trying to create a composite component that will take as parameters a string and a max number of characters and then will show only the max amount of characters, but it will have a "more" link next to it, that when clicked will expand the text to…
On my Dell Studio 15, the function keys, by default, do things like switch the radio on/off or change the brightness or sound. To use them as function keys I have to hold down the Fn modifier.
I use function keys as function keys a lot more often than I want to change the volume or…
Out of the blue, OpenSCAD decided to stop working for me on designs that previously rendered just fine. After playing around I found out that any time I use a precision greater than $fn=29 the program crashes with the message "openscad.exe has stopped working". I can use any…
In SQL Server 2008.
I need execute a query like that:
DECLARE @x AS xml
SET @x=N'<r><c>First Text</c></r><r><c>Other Text</c></r>'
SELECT @x.query('fn:max(r/c)')
But return nothing (apparently because convert…
I can turn the touchpad off in the mouse settings, but two things won't work:
The "disable while typing" option
The standard on/off button for the touch pad won't work (it's the one with the little touchpad symbol crossed off, on the F6 key). I've tried any…