This snippet can be used to query for an element with a specific attribute value and replace that value. In the example below (for shadowbox), a rel attribute was set with "player=flv".
We were using swfobject to detect for the presence of a flash player [(swfobject.hasFlashPlayerVersion("8"))] in the event of flash player not being installed and javascript being enabled, I needed to be able to rewrite the rel attributes to get shadowbox to use a different player. This JQuery example worked nicely by allowing us to query the DOM for all anchor elements containing rel attributes which contained "flv" - and to replace all instances of "flv" with "qt":
Friday, 2 October 2009
Subscribe to:
Posts (Atom)
Blog Archive
-
►
2011
(35)
-
►
June
(6)
- MarkLogic/XCC: Copying a Module with User Content ...
- MarkLogic: clearing a forest in a database program...
- MarkLogic: Enabling debug options when using the S...
- Linux: SCP syntax and structure note
- MarkLogic/XCC: Installing Modules Programatically
- Eclipse: Installing XQDT (and DLTK) on Eclipse Ind...
-
►
June
(6)
-
►
2010
(43)
-
►
September
(7)
- MarkLogic: Creating Multiple Range Element Indexes...
- MarkLogic: Listing all Collections in a Database
- MarkLogic: Basic Database Cloning Script
- MarkLogic: Estimating the number of documents cont...
- MarkLogic: Search: Compound OR Queries
- MarkLogic: XQuery: Check for the presence of an el...
- MarkLogic: XQuery: Type Validation using xsi:type
-
►
September
(7)