Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Old question but new answer. I've recently released version 1.1 of <a href="https://github.com/jamietre/CsQuery">CsQuery</a>, a jQuery port for .NET 4 written in C# that I've been working on for about a year. Also on <a href="http://www.nuget.org/packages/CsQuery">NuGet</a> as "CsQuery"</p> <p>The current release implements all CSS2 &amp; CSS3 selectors, all jQuery extensions, and all jQuery DOM manipulation methods. It's got extensive test coverage including all the tests from jQuery and sizzle (the jQuery CSS selection engine). I've also included some performance tests for direct comparisons with Fizzler; for the most part CsQuery dramatically outperforms it. The exception is actually loading the HTML in the first place where Fizzler is faster; I assume this is because fizzler doesn't build an index. You get that time back after your first selection, though.</p> <p>There's documentation on the github site, but at a basic level it works like this:</p> <p>Create from a string of HTML</p> <pre><code>CQ dom = CQ.Create(htmlString); </code></pre> <p>Load synchronously from the web</p> <pre><code>CQ dom = CQ.CreateFromUrl("http://www.jquery.com"); </code></pre> <p>Load asynchronously (non-blocking)</p> <pre><code>CQ.CreateFromUrlAsync("http://www.jquery.com", responseSuccess =&gt; { Dom = response.Dom; }, responseFail =&gt; { .. }); </code></pre> <p>Run selectors &amp; do jQuery stuff</p> <pre><code>var childSpans = dom["div &gt; span"]; childSpans.AddClass("myclass"); </code></pre> <p>the <code>CQ</code> object is like thejQuery object. The property indexer used above is the default method (like <code>$(...)</code>.</p> <p>Output:</p> <pre><code>string html = dom.Render(); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload