sizzle

How to select table cells without selecting nested table cells in jQuery

I want to select only the first level of 'td' elements in a table and not the cells of any nested tables. eg: <table id="Outer"> <tr> <td> --this one </td> <td> --this one <table> <tr> <td></td> -- but not this one or any deeper nested cells <...

makeArray function in Sizzle (jQuery 1.3)

I've been having a lot of problems with jQuery 1.3.2 on only one of my sites. It's a Joomla site, so Mootools is included on the page as well (and it's too difficult to remove Mootools). Basically the problem is that calling the basic jQuery selector with one selector (eg: "a", ".myClass", not "html a", ".myClass td"), will only return t...

jQuery selector bug? composed selector vs. simple selector & find()

Something is very awkward about my situation... i have something like this: <div id="selector"> <input type='radio' /> <input type='radio' /> <input type='radio' /> </div> if I use $("#selector input[type=radio]") all three elements are found, but if I use $("#selector").find("input[type=radio]") or even find("input") only th...

Style table cells using jQuery

I'm trying to style table cells within a table based upon whether or not the contain the character | in the url or not (don't ask, dealing with SharePoint). Sample HTML; <table> <tr> <td class="ms-cal-workitem"> <table> <tr> <td class="ms-cal-monthitem"> <a href="http://localhost:4657/1"&gt;Event 1</a> </td> </tr> </table> </td> </tr> ...

Adding Sizzle js to my project breaks the project

I'm not entirely sure what's happening here. I have my code that exists like: var mycode = { init:function(){ //my code here } } //sizzle pasted here... (function(){ //sizzle code here })(); Where "sizzle code here" is the copy/paste of Sizzle in its entirety. Sizzle is contained in an anonymous function, so I'm not s...

Using jQuery's Sizzle Engine to find a class (advanced)

What I am attempting to do is see if a jQuery object (or even DOM element for that matter) contains a particular class using the same selectors as the Sizzle engine. jQuery publicly exposes Sizzle with the following: jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; jQuery.unique = Sizzle.uni...

CSS parser/abstracter? How to convert stylesheet into object

Is there a standard or reliable method already out there for a javascript framework such as jquery to parse a stylesheet into an object? Two reasons for why I'm wondering: I have seen a couple of questions where someone wanted to know how to get the style attribute that was set by the stylesheet for a selector, not what the selector e...

jQuery/Sizzle selector to find current element's parent?

Is there a way I can get the selected element's parent using only jQuery's/sizzle's CSS selectors? I need to be able to get an element's parent while using jQuery, but I'm unable use jQuery('#myelement').parent() since I'm receiving the selector as a string and the "user" needs to be able to move back up the tree. I can't see anything ...

Including a minified js code in another js library

I want to incorporate a minified javascript library (for example http://sizzlejs.com/) into my own non minified javascript library. The reason is that my library plugs into other websites and I don't want to ask them to include the extra library (sizzle) as well. Is there a way to include a minified library in a non minified library and...

Explain a block of crazy JS code inside Sizzle(the CSS selector engine)

So, here is the function for pre-filtering "CHILD": function(match){ if ( match[1] === "nth" ) { // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || !/\D/.test( match...

Is there a JQuery DOM manipulator/CSS selector equivalent class in PHP?

I know that I can use DOMDocument and DOMXPath to manipulate XML files. But, I really love JQuery, and it would be great if there was something more like JQuery in the PHP world that I could use for sever side DOM manipulation. NOTE: I'm only interested here in how JQuery Selects and Manipulates the DOM, not all the other parts...

Minified Sizzle

Hello guys. I can't find minified sizzle =( And if i trying to make it myself by yuicompressor, after that, some features not work. Please help. ...

Exception thrown in YUI: "Sizzle" is not defined!

Hi, We are using HTML Unit v2.6 with Web-Harvest and extended its functionality to create a new element <web session="sess1" browser="firefox2"> <web-getpage url="https://www.linkedin.com/secure/login"/&gt; <web-setinput name="uname">username</web-setinput> <web-setinput name="pwd">password</web-setinput> <web-clickinput name="login"/...

JavaScript - Having trouble with a click event.

Hi, I am using sizzle to select various parts of the DOM. My code is below. The problem is that the onmouseup event is being triggered when the page is loaded instead of when the user interacts with the page. Can someone explain why this is please. Thanks. // Effects object var effects = { // Display an object show : functio...

jQuery Optimization/Best Practices

Ok saddle up cowboys, because this is going to be a long one. I have been spending the morning going through some of my old code and I'm left wondering about best practices and optimzation. In order to avoid a ride down subjective lane I'll just post some examples with some hopefully easy to answer questions. I will try to keep the examp...

Slick vs. Sizzle -- Pros and Cons of CSS selector engines

When would I want to use Slick and when would I want to use Sizzle? What are the pros and cons of each as a standalone CSS selector engine? How easily can Slick be used with JQuery? Can Sizzle be used with Mootools? ...

What jQuery selector can I use to match these HTML elements (requires ":contains()")?

I'm trying to find a jQuery selector that will match only the element that directly contains the text "PDT" in the following two examples (truncated for brevity): <div> <p> <strong>(07-27) 21:28 PDT SAN FRANCISCO</strong> -- San Francisco supervisors ended more than a decade... </p> <p>The 10-1 vote, with only Supervisor C...

Can't iterate array returned from Sizzle.

From my understanding Sizzle returns an array of objects (DOMElements), I am trying to walk that array of objects in a for loop but I am getting errors. When I try to get a property with the obj[index-number]["property"] it works fine, but when I try to access it after passing it to another function obj[index-number][arguments[index-...

Sizzle selector syntax pattern of searchable items

Hey guys, I'm still learning how to use Sizzle selector. So far I know this: Sizzle('#blah') - searches the entire document for element(s) with id 'blah'. Sizzle('.blah') - searches the entire document for element(s) with css class 'blah'. Then today I found this: Sizzle('> div') - searches entire document for elements of 'div' tag...

Need Help finding out howto use Twitter's @anywhere isFollowing/isFollowedBy methods

I am trying to check via the Twitter Javascript Api (see here) if a logged in user is following me on twitter. If not, i will display a followbutton. Right now i can't seem to find out how the command isFollowing/isFollowedBy works (see doc). Code so far: twttr.anywhere( function (T) { if(T.User.find('mashable').isFollowing){ ...