Topic: jQuery Wildcard

Jau google nebepadeda man, gal bus kas zino kaip isprest sia beda.

Noriu paimti bet kuri ID elementa prasidedant "node" tekstu ir sudaryti jam click event'a.

Pvz kaip bandau:

$("*[id^='node']").click(function() {
    alert('Test');
});

Nieko nesigauna, FireBug ismeta tona klaidu kuriu net neina suprast normaliai:

uncaught exception: [Exception... "Not enough arguments [nsIDOMWindowInternal.alert]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://url :: anonymous :: line 127" data: no]
[Break On This Error] (no source for )
uncaught exception: [Exception... "Not enough arguments [nsIDOMWindowInternal.alert]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://url :: anonymous :: line 127" data: no]
[Break On This Error] (no source for )
uncaught exception: [Exception... "Not enough arguments [nsIDOMWindowInternal.alert]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://url :: anonymous :: line 127" data: no]
[Break On This Error] (no source for )
uncaught exception: [Exception... "Not enough arguments [nsIDOMWindowInternal.alert]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://url :: anonymous :: line 127" data: no]

Re: jQuery Wildcard

"#node*" ?

Ta prasme objektus su tokiais ID, kurie prasideda "node" ar ne?

Re: jQuery Wildcard

Aha minde, gerai supratai. bet tavo variantas neveikia. Nereaguoja visiskai. Jau pasidariau pagaliau su filter.

$("li").filter(function(){return this.id.match(/node+/);}).click(function() {
    alert('test');
});

Re: jQuery Wildcard

Mjo. O nesunku pabandyt: "#node\\S*" ?