¡@

Home 

2014/10/16 ¤W¤È 12:01:53

jquery Programming Glossary: alternatively

Two jQuery versions on the same page

http://stackoverflow.com/questions/1117463/two-jquery-versions-on-the-same-page

with j ... while the second one can be accessed with ... . Alternatively somebody made a little helper in an attempt to make it easier..

Why does jQuery or a DOM method such as `getElementById` not find the element?

http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element

document .ready function do stuff when DOM is ready Alternatively you can also use the shorthand syntax function do stuff when..

JqGrid need hyperlink - need to capture value through Jquery

http://stackoverflow.com/questions/14529358/jqgrid-need-hyperlink-need-to-capture-value-through-jquery

information which you need directly from the database. Alternatively you can use the simple trick described in the answer . You define..

How to expose IFrame's DOM using jQuery?

http://stackoverflow.com/questions/1654017/how-to-expose-iframes-dom-using-jquery

school name attribute instead of or as well as the id . Alternatively if you know the order of iframes on the page you can index them..

jquery live hover

http://stackoverflow.com/questions/2262480/jquery-live-hover

one event handler function table tr .live hover function Alternatively you can provide two functions one for mouseenter and one for..

How can I make a jQuery UI 'draggable()' div draggable for touchscreen?

http://stackoverflow.com/questions/3026915/how-can-i-make-a-jquery-ui-draggable-div-draggable-for-touchscreen

to drag on my iPhone whereas jQuery UI Draggable doesn't. Alternatively you can try this plugin though that might require you to actually..

How to style “input file” with CSS3 / Javascript?

http://stackoverflow.com/questions/3226167/how-to-style-input-file-with-css3-javascript

I would like to style input type file using CSS3. Alternatively I would like user to press on a div that I will style and this..

jQuery.proxy() usage

http://stackoverflow.com/questions/3349380/jquery-proxy-usage

event self.name this.value captures self in a closure Alternatively we could have used jQuery.proxy here so the reference to this..

JQuery: How to select rows from a table

http://stackoverflow.com/questions/3585272/jquery-how-to-select-rows-from-a-table

'table' .css 'border' '1px solid red' this should do it Alternatively using .filter tr .filter function return .trim this .find 'td..

Error: Uncaught SyntaxError: Unexpected token <

http://stackoverflow.com/questions/3630006/error-uncaught-syntaxerror-unexpected-token

up your javascripts script CDATA insert teh codez script Alternatively move your javascript to a separate file. Edit Ahh.. with that..

How to implement a chat room using Jquery/PHP?

http://stackoverflow.com/questions/4174521/how-to-implement-a-chat-room-using-jquery-php

request var comet new Comet comet.connect script body html Alternatively You can also have a look at other chat applications to see how..

Preloading images with jQuery

http://stackoverflow.com/questions/476679/preloading-images-with-jquery

arrayOfImages .each function ' img ' 0 .src this Alternatively you could use new Image .src this Usage preload 'img imageName.jpg'..

Access to restricted URI denied code: 1012

http://stackoverflow.com/questions/51283/access-to-restricted-uri-denied-code-1012

callback will be automatically added to your Ajax request. Alternatively you could make your ajax request to a server side script which..

how to get selection inside a div using jquery/javascript

http://stackoverflow.com/questions/5801347/how-to-get-selection-inside-a-div-using-jquery-javascript

selectedText textRange.text return selectedText Alternatively you could use my Rangy library and the code becomes function..

Why does click event handler fire immediately upon page load?

http://stackoverflow.com/questions/7102413/why-does-click-event-handler-fire-immediately-upon-page-load

work document .ready function 'a.test' .bind click showDiv Alternatively you could use an anonymous function to perform a more advanced..

How to refer to a JSF component Id in jquery?

http://stackoverflow.com/questions/7132061/how-to-refer-to-a-jsf-component-id-in-jquery

then you need to give exactly that component a fixed ID. Alternatively you can use # component.clientId to let EL print the component's..

Creating a div element in jQuery

http://stackoverflow.com/questions/867916/creating-a-div-element-in-jquery

or .class then use the .append div foo div function. Alternatively you can use the .html as mentioned above. #foo .append div hello..

Javascript Print iframe contents only

http://stackoverflow.com/questions/9616426/javascript-print-iframe-contents-only

printf .print and use iframe id printf name printf iframe Alternatively try good old var newWin window.frames printf newWin.document.write..

Write elements into a child iframe using Javascript or jQuery

http://stackoverflow.com/questions/997986/write-elements-into-a-child-iframe-using-javascript-or-jquery

div A div div B div div C div body html iframe body html Alternatively any plain old Javascript would be fine. Thanks. Edit After a..

jqgrid addJSONData doesn't work

http://stackoverflow.com/questions/10407186/jqgrid-addjsondata-doesnt-work

7 f 8 In some scenarios one can use jQuery.serializeArray alternatively. It allows to serialize the data in another format like JSON..

Remove vertical lines in jqGrid

http://stackoverflow.com/questions/11790302/remove-vertical-lines-in-jqgrid

th column border right color transparent important or alternatively without the usage of important .ui jqgrid labels .ui th column..

Get Selected value from Multi-Value Select Boxes by jquery-select2?

http://stackoverflow.com/questions/12889309/get-selected-value-from-multi-value-select-boxes-by-jquery-select2

Selected value is .leaderMultiSelctdropdown .select2 val alternatively if you used a regular selectbox as base you should be able to..

jquery reference this from parent

http://stackoverflow.com/questions/13474468/jquery-reference-this-from-parent

function resp if resp.colour self.colour use self ... alternatively on ES5 browsers use .bind to set the context of the inner callback..

jqgrid delete: not getting value

http://stackoverflow.com/questions/14194139/jqgrid-delete-not-getting-value

'protocolStageDelete' protID function return protID or alternatively mtype 'GET' url 'ProtocolJGridServChildStages' onclickSubmit..

jquery fancybox, iframe or ajax, load with url

http://stackoverflow.com/questions/15281530/jquery-fancybox-iframe-or-ajax-load-with-url

and the iframe.html page loaded into the fancybox window alternatively it can be a .txt file loaded via ajax too . HTML a class fancybox..

scripting a google docs form submission

http://stackoverflow.com/questions/2128367/scripting-a-google-docs-form-submission

that will be called when google sends back their response. alternatively you should be able to use firebug to view the response google..

Is it possible to “fake” the src attribute of an iframe?

http://stackoverflow.com/questions/3462758/is-it-possible-to-fake-the-src-attribute-of-an-iframe

. iframe src data text html .... URLencoded HTML data .... alternatively iframe src data text html base64 .... base64 encoded HTML data..

Detecting width: auto in jQuery

http://stackoverflow.com/questions/3557718/detecting-width-auto-in-jquery

an integer it would return either auto or undefined . Or alternatively is there an equivalent of a isAuto function javascript jquery..

Appending dynamically generated html using jQuery does not play well with Fancybox

http://stackoverflow.com/questions/3574100/appending-dynamically-generated-html-using-jquery-does-not-play-well-with-fancyb

of new elements jQuery #events .item_pop .fancybox ... Or alternatively and less efficient you can use the .livequery plugin like this..

Download File Using Javascript/jQuery

http://stackoverflow.com/questions/3749231/download-file-using-javascript-jquery

value such as application x please download me or alternatively application octet stream which is used for arbitrary binary..

Posting JSON with JQuery

http://stackoverflow.com/questions/3854629/posting-json-with-jquery

but no. Anyone know the correct ajax configuration or alternatively a way of serialising the 'data' parameter as JSON prior to posting..

Add <Script … /> tag within <Head … /> tag in ServerControl (ASP.NET)?

http://stackoverflow.com/questions/4117712/add-script-tag-within-head-tag-in-servercontrol-asp-net

control the first method is probably more preferable. EDIT alternatively you can register scripts in the head tag of the page as follows..

Hide/Show Column in an HTML Table

http://stackoverflow.com/questions/455958/hide-show-column-in-an-html-table

to avoid having to add the class attributes to tds. Or alternatively if your concern is making the markup cleaner you could add them..

“Disable” a link temporarily when clicked?

http://stackoverflow.com/questions/5380722/disable-a-link-temporarily-when-clicked

isAnimating false 2000 set to false in 2 seconds alternatively you could wait until your animation is done call animation code..

JavaScript Drag & Select functionality done right

http://stackoverflow.com/questions/5851156/javascript-drag-select-functionality-done-right

out. Think of it as an RTS strategy selecting units or alternatively any vector graphics editor selecting objects for moving them..

jQuery fade out then fade in

http://stackoverflow.com/questions/6287308/jquery-fade-out-then-fade-in

var this this this.fadeOut function this.next .fadeIn alternatively you can just pause the chain but you need to specify for how..

Amazon-like interface for selecting product size and color (i.e., click a little red box to select a red product, etc)

http://stackoverflow.com/questions/717988/amazon-like-interface-for-selecting-product-size-and-color-i-e-click-a-little

radio input elements. Some sort of .radio js class could alternatively be added on the UL wrapper to get the same thing done. Firstly..

How use mask in input field in JSF 2 + RichFaces 4?

http://stackoverflow.com/questions/7883262/how-use-mask-in-input-field-in-jsf-2-richfaces-4

tin' .mask 99 9999999 id 'form ssn' .mask 999 99 9999 Or alternatively just give them a classname h inputText id date styleClass date..

Ajax - How refresh <DIV> after submit

http://stackoverflow.com/questions/868890/ajax-how-refresh-div-after-submit

pesquisar.action this .ajaxSubmit options return false alternatively you could get the server to return just the html that needs..

Two jQuery versions on the same page

http://stackoverflow.com/questions/1117463/two-jquery-versions-on-the-same-page

jQuery version. The first one you load can be accessed with j ... while the second one can be accessed with ... . Alternatively somebody made a little helper in an attempt to make it easier to switch between different versions. share improve this..

Why does jQuery or a DOM method such as `getElementById` not find the element?

http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element

is ready. To do this we register a ready event for the document. document .ready function do stuff when DOM is ready Alternatively you can also use the shorthand syntax function do stuff when DOM is ready Both are equivalent. share improve this answer..

JqGrid need hyperlink - need to capture value through Jquery

http://stackoverflow.com/questions/14529358/jqgrid-need-hyperlink-need-to-capture-value-through-jquery

the action the id of the row you can get any other additional information which you need directly from the database. Alternatively you can use the simple trick described in the answer . You define CSS class .myLink text decoration underline cursor pointer..

How to expose IFrame's DOM using jQuery?

http://stackoverflow.com/questions/1654017/how-to-expose-iframes-dom-using-jquery

'iframe_name' This requires that you give the iframe an old school name attribute instead of or as well as the id . Alternatively if you know the order of iframes on the page you can index them numerically var iframewindow frames 0 It's generally more..

jquery live hover

http://stackoverflow.com/questions/2262480/jquery-live-hover

jQuery 1.4.1 now supports hover for live events but only with one event handler function table tr .live hover function Alternatively you can provide two functions one for mouseenter and one for mouseleave table tr .live mouseenter function mouseleave function..

How can I make a jQuery UI 'draggable()' div draggable for touchscreen?

http://stackoverflow.com/questions/3026915/how-can-i-make-a-jquery-ui-draggable-div-draggable-for-touchscreen

touch plugin you can try an example here . It works fine to drag on my iPhone whereas jQuery UI Draggable doesn't. Alternatively you can try this plugin though that might require you to actually write your own draggable function. As a sidenote Believe..

How to style “input file” with CSS3 / Javascript?

http://stackoverflow.com/questions/3226167/how-to-style-input-file-with-css3-javascript

to style &ldquo input file&rdquo with CSS3 Javascript I would like to style input type file using CSS3. Alternatively I would like user to press on a div that I will style and this will open the Browse window. Is that possible to do that..

jQuery.proxy() usage

http://stackoverflow.com/questions/3349380/jquery-proxy-usage

'' var self this store reference to this el .change function event self.name this.value captures self in a closure Alternatively we could have used jQuery.proxy here so the reference to this refers to the object of Person instead of the element that..

JQuery: How to select rows from a table

http://stackoverflow.com/questions/3585272/jquery-how-to-select-rows-from-a-table

0 ' .text x .trim this .find 'td eq 1 ' .text y this .closest 'table' .css 'border' '1px solid red' this should do it Alternatively using .filter tr .filter function return .trim this .find 'td eq 0 ' .text 'John' .trim this .find 'td eq 1 ' .text 'Smith'..

Error: Uncaught SyntaxError: Unexpected token <

http://stackoverflow.com/questions/3630006/error-uncaught-syntaxerror-unexpected-token

the angle bracket as an HTML tag. Try doing this when setting up your javascripts script CDATA insert teh codez script Alternatively move your javascript to a separate file. Edit Ahh.. with that link I've tracked it down. What I said was the issue wasn't..

How to implement a chat room using Jquery/PHP?

http://stackoverflow.com/questions/4174521/how-to-implement-a-chat-room-using-jquery-php

new Ajax.Request this.url method 'get' parameters 'msg' request var comet new Comet comet.connect script body html Alternatively You can also have a look at other chat applications to see how they did it http hot things.net q blite BlaB Lite is an AJAX..

Preloading images with jQuery

http://stackoverflow.com/questions/476679/preloading-images-with-jquery

improve this question Quick and easy function preload arrayOfImages arrayOfImages .each function ' img ' 0 .src this Alternatively you could use new Image .src this Usage preload 'img imageName.jpg' 'img anotherOne.jpg' 'img blahblahblah.jpg' Or if you..

Access to restricted URI denied code: 1012

http://stackoverflow.com/questions/51283/access-to-restricted-uri-denied-code-1012

specified callback. Or if you set the dataType to jsonp a callback will be automatically added to your Ajax request. Alternatively you could make your ajax request to a server side script which does the cross domain call for you then passes the data back..

how to get selection inside a div using jquery/javascript

http://stackoverflow.com/questions/5801347/how-to-get-selection-inside-a-div-using-jquery-javascript

EndToEnd textRange 1 textRange.setEndPoint EndToEnd selTextRange selectedText textRange.text return selectedText Alternatively you could use my Rangy library and the code becomes function getSelectedTextWithin el var selectedText var sel rangy.getSelection..

Why does click event handler fire immediately upon page load?

http://stackoverflow.com/questions/7102413/why-does-click-event-handler-fire-immediately-upon-page-load

to the function that should be executed. This should work document .ready function 'a.test' .bind click showDiv Alternatively you could use an anonymous function to perform a more advanced function ...bind 'click' function foo.showDiv a b c ...more..

How to refer to a JSF component Id in jquery?

http://stackoverflow.com/questions/7132061/how-to-refer-to-a-jsf-component-id-in-jquery

see an autogenerated ID like j_id123 in the client ID chain then you need to give exactly that component a fixed ID. Alternatively you can use # component.clientId to let EL print the component's client ID to the generated HTML output. You can use component's..

Creating a div element in jQuery

http://stackoverflow.com/questions/867916/creating-a-div-element-in-jquery

Javascript Print iframe contents only

http://stackoverflow.com/questions/9616426/javascript-print-iframe-contents-only

work try instead window.frames printf .focus window.frames printf .print and use iframe id printf name printf iframe Alternatively try good old var newWin window.frames printf newWin.document.write ' body onload window.print dddd body ' newWin.document.close..

Write elements into a child iframe using Javascript or jQuery

http://stackoverflow.com/questions/997986/write-elements-into-a-child-iframe-using-javascript-or-jquery

iframe id someFrame inside the iframe's content html body div A div div B div div C div body html iframe body html Alternatively any plain old Javascript would be fine. Thanks. Edit After a little more research it seems I am looking for an IE equivalent..

jqgrid addJSONData doesn't work

http://stackoverflow.com/questions/10407186/jqgrid-addjsondata-doesnt-work

be appended with parameters from the form a 1 b 2 c 3 d 4 e 7 f 8 In some scenarios one can use jQuery.serializeArray alternatively. It allows to serialize the data in another format like JSON or convert the data in some another format see here which can..

Remove vertical lines in jqGrid

http://stackoverflow.com/questions/11790302/remove-vertical-lines-in-jqgrid

vertical borders between the column headers you can use th.ui th column border right color transparent important or alternatively without the usage of important .ui jqgrid labels .ui th column border right color transparent See the old answer So you..

Get Selected value from Multi-Value Select Boxes by jquery-select2?

http://stackoverflow.com/questions/12889309/get-selected-value-from-multi-value-select-boxes-by-jquery-select2

jquery jquery select2 share improve this question alert Selected value is .leaderMultiSelctdropdown .select2 val alternatively if you used a regular selectbox as base you should be able to use the normal jquery call too alert Selected value is .leaderMultiSelctdropdown..

jquery reference this from parent

http://stackoverflow.com/questions/13474468/jquery-reference-this-from-parent

to .getJSON do function var self this .getJSON 'getcolour.php' function resp if resp.colour self.colour use self ... alternatively on ES5 browsers use .bind to set the context of the inner callback to this do function .getJSON 'getcolour.php' function..

jqgrid delete: not getting value

http://stackoverflow.com/questions/14194139/jqgrid-delete-not-getting-value

mtype 'GET' url 'ProtocolJGridServChildStages' delData action 'protocolStageDelete' protID function return protID or alternatively mtype 'GET' url 'ProtocolJGridServChildStages' onclickSubmit function options rowid var rowData jQuery this .jqGrid 'getRowData'..

jquery fancybox, iframe or ajax, load with url

http://stackoverflow.com/questions/15281530/jquery-fancybox-iframe-or-ajax-load-with-url

Load the index page with the fancybox window opened and the iframe.html page loaded into the fancybox window alternatively it can be a .txt file loaded via ajax too . HTML a class fancybox fancybox.iframe href iframe.html Iframe a Fancybox script..

scripting a google docs form submission

http://stackoverflow.com/questions/2128367/scripting-a-google-docs-form-submission

the form via ajax .ajax . You can setup a success function that will be called when google sends back their response. alternatively you should be able to use firebug to view the response google sends back. Specifically I was thinking you could try something..

Is it possible to “fake” the src attribute of an iframe?

http://stackoverflow.com/questions/3462758/is-it-possible-to-fake-the-src-attribute-of-an-iframe

share improve this question You could look into data URIs . iframe src data text html .... URLencoded HTML data .... alternatively iframe src data text html base64 .... base64 encoded HTML data .... The scheme is supported by IE 8 MSDN source Firefox..

Detecting width: auto in jQuery

http://stackoverflow.com/questions/3557718/detecting-width-auto-in-jquery

using jQuery That is instead of the above example returning an integer it would return either auto or undefined . Or alternatively is there an equivalent of a isAuto function javascript jquery css dom computed style share improve this question I..

Appending dynamically generated html using jQuery does not play well with Fancybox

http://stackoverflow.com/questions/3574100/appending-dynamically-generated-html-using-jquery-does-not-play-well-with-fancyb

html You need to run the .fancybox call again on this set of new elements jQuery #events .item_pop .fancybox ... Or alternatively and less efficient you can use the .livequery plugin like this jQuery .item_pop .livequery function jQuery this .fancybox..

Download File Using Javascript/jQuery

http://stackoverflow.com/questions/3749231/download-file-using-javascript-jquery

you need the server to set the file's MIME Type to a nonsensical value such as application x please download me or alternatively application octet stream which is used for arbitrary binary data. If you only want to open it in a new tab the only way..

Posting JSON with JQuery

http://stackoverflow.com/questions/3854629/posting-json-with-jquery

either the dataType or contentType params would do the trick but no. Anyone know the correct ajax configuration or alternatively a way of serialising the 'data' parameter as JSON prior to posting Thanks jquery json jquery ajax share improve this..

Add <Script … /> tag within <Head … /> tag in ServerControl (ASP.NET)?

http://stackoverflow.com/questions/4117712/add-script-tag-within-head-tag-in-servercontrol-asp-net

the script in your .aspx page. If this is a public server control the first method is probably more preferable. EDIT alternatively you can register scripts in the head tag of the page as follows HtmlGenericControl jqueryInclude new HtmlGenericControl..

Hide/Show Column in an HTML Table

http://stackoverflow.com/questions/455958/hide-show-column-in-an-html-table

away with not supporting IE6 you could use adjacency selectors to avoid having to add the class attributes to tds. Or alternatively if your concern is making the markup cleaner you could add them from JavaScript automatically in an initialisation step...

“Disable” a link temporarily when clicked?

http://stackoverflow.com/questions/5380722/disable-a-link-temporarily-when-clicked

.click function e if isAnimating isAnimating true setTimeout isAnimating false 2000 set to false in 2 seconds alternatively you could wait until your animation is done call animation code else e.preventDefault return false from your click handler..

JavaScript Drag & Select functionality done right

http://stackoverflow.com/questions/5851156/javascript-drag-select-functionality-done-right

to be able drag the cursor over the area where they are laid out. Think of it as an RTS strategy selecting units or alternatively any vector graphics editor selecting objects for moving them around and editing . First of all I'm aware of things that..

jQuery fade out then fade in

http://stackoverflow.com/questions/6287308/jquery-fade-out-then-fade-in

Using your code '#two #three' .hide '.slide' .click function var this this this.fadeOut function this.next .fadeIn alternatively you can just pause the chain but you need to specify for how long this .fadeOut .next .delay 500 .fadeIn share improve..

Amazon-like interface for selecting product size and color (i.e., click a little red box to select a red product, etc)

http://stackoverflow.com/questions/717988/amazon-like-interface-for-selecting-product-size-and-color-i-e-click-a-little

that don't have JavaScript but still have CSS will see the radio input elements. Some sort of .radio js class could alternatively be added on the UL wrapper to get the same thing done. Firstly float the buttons and give them a more button like appearance..

How use mask in input field in JSF 2 + RichFaces 4?

http://stackoverflow.com/questions/7883262/how-use-mask-in-input-field-in-jsf-2-richfaces-4

.mask 99 99 9999 id 'form phone' .mask 999 999 9999 id 'form tin' .mask 99 9999999 id 'form ssn' .mask 999 99 9999 Or alternatively just give them a classname h inputText id date styleClass date h inputText id phone styleClass phone h inputText id tin..

Ajax - How refresh <DIV> after submit

http://stackoverflow.com/questions/868890/ajax-how-refresh-div-after-submit

html url http localhost 8081 sniper estabelecimento pesquisar.action this .ajaxSubmit options return false alternatively you could get the server to return just the html that needs to be inserted into the div rather than the rest of the html..