Never been to DZone Snippets before? Snippets is a public source code repository. Easilybuild up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world Greasemonkey script to get allxpath expressions of 'a' and 'input type=submit' elements in a document (See related posts) This greasemonkey script uses the JS files loading mechanism that C
id:amachang がリリースしたJavaScript-XPath が、かなり良さげ。JavaScript-XPath の検索結果を jQuery オブジェクトにして、利用できると便利そうなので、以下のようなコードを書いてみた。 (function(jQuery){ jQuery.xpath = function(selector, context){ context = context || jQuery(document); var r, res=[]; context.each(function() { r = document.evaluate(selector, this, null, 7, null); for(var node_no=0; node_no<r.snapshotLength; node_no++){ res.push(r.snapshotItem(nod
JavaScript-XPathJavaScript-XPath is the FASTEST DOM 3XPath (XPath 1.0) implementation inJavaScript. This code runs 10 times faster thanGoogle Ajaxslt'sxpath.js!! Release/Download Latest Version Latest Compressed Version If you can use subversion, check out the trunk with: svn co http://svn.coderepos.org/share/lang/javascript/javascript-xpath/trunk/ jsxpath Bindings jQuery Prototype YUI How to
8 年。 世界がXPath の真の実力を発見するのに要した時間である。 1999 年、W3C により勧告されたXPath は、「なにコレ読めねえwwwXPath きめえwww」などと言われもした、 ともすれば不遇とすらいい得る歳月を経て、あたりのそこここに満ち充ちていた「DOM まじめんどくせえ」という思いによって、ふたたび表舞台に招来された。XPath は、DOM ツリーの「ancestor」と「descendant」、「lastChild」と「firstChild」とを取り結ぶ、もっとも古くてもっとも新しい、そして、もっとも重要な技術だ。次の 8 年を自らの手で創り出すために、私は DOM 3XPath に注目した。XPath
JavaScript-XPath とはJavaScript-XPath は、 DOM 3XPath を実装していないブラウザに対して、実用的な速度で動作する DOM 3XPath のエンジンを追加します。 一言で乱暴に言ってしまえば、どのブラウザでも document.evaluate って関数でXPath 使えるようになるよ!ってことです。 以下が公式サイトになります。 http://coderepos.org/share/wiki/JavaScript-XPath DOM 3XPath ってなんなの!? めっちゃ簡単(で、ちょっとだけ適当)なDOM 3XPath の説明をします><。JavaScript でよく使う document.getElementById や document.getElementsByTagName って関数ありますよね? DOM 3XPath
昨日のエントリのブクマやコメントで jQuery からの移行がめんどう 時代は jQuery のようなコメントがありました。 これらのコメントから おそらく、「XPath が jQuery や YUI、Prototype.js、Dojo、MochiKit などの汎用 JS ライブラリと競合する」と思ってる方が多いのかなと思いました。 結論XPath は汎用 JS ライブラリとは競合する技術ではなく、共存する技術だと僕は考えています。 理由 汎用的な JS のライブラリには、大きく以下のような機能があります。 DOM ツリー上の要素やノードを取得する DOM に新しい要素やノード、属性、プロパティ、イベントなどを追加する その他、クロスブラウザとか それに対してXPath が提供するのは DOM ツリー上の要素やノードを取得する というシンプルな機能だけです。 つまり、XPath は汎
Latesttopics >CSS3セレクタとXPathでの表現の対応表 宣伝。日経LinuxにてLinuxの基礎?を紹介する漫画「シス管系女子」を連載させていただいています。 以下の特設サイトにて、単行本まんがでわかるLinux シス管系女子の試し読みが可能! « getElementsByなんちゃら の代わりにXPathを使う Main Mozilla 24 »CSS3セレクタとXPathでの表現の対応表 - Sep 13, 2007拡張機能勉強会の時に焚き付けられた、Text Shadowのコード(textshadow.js)を教材にして拡張機能開発のノウハウを解説していくシリーズ。XPathをノードの検索に活用する方法を紹介したけど、肝心のXPathが書けなきゃ意味がないわけで。でもXPathって、ノードセットがどうとかノードテストがどうとか軸がどうとか修飾がどうとか、い
Greasemonkey - Mozilla Firefox まとめサイト で、Dive Into Greasemonkey の日本語訳 (PDF)が公開されてます。 これは凄く良い仕事。いやマジで。超感謝。 で、それの28頁以下で、Firefox に組み込まれたXPath のサポートの使い方が説明されてまして、これで /getElements?By.+/ 地獄からおさらば出来るわけですが、XPath を解釈するのに使う document.evaluate は引数がたくさんあって、生で使うのは面倒いです。 でも使う引数はクエリ部分以外は普通は決まってるので、30頁以下で、XPathを楽に使うために以下の関数を定義すると良いよね、とあります。
Looking for information about InformaTechTarget products and services? The commercial homepage has moved. Visit InformaTechTarget News 29 Jul 2025 / Software Design & Development WhatAmazon Q prompt injection reveals aboutAIsecurity Experts said a malicious prompt injection in theAmazon Q extension for VS Code doesn't represent a fundamentally new threat but reflects howAI amplifies securit

適当にXPath を試したい時に 以下のようにすれば、簡単にXPath をためせます。 document.evaluate( '//div[@class="hoge"]', //XPath 式 document, // 基準となるノード(要素とか null, // 名前空間の解決方法(適当にやるときは null 6, // 取得する形式の指定(適当にやるときは 6 null // 結果を再利用するかどうか(適当にやるときは null ); 簡単ですね。 document.evaluate、式、ドキュメント、ヌル、6、ヌル。 覚えましたか? でも、これを Firebug で実行するとこうなっちゃいます。 うーん。これではどの要素が選択されたかわかりません>< 不便ですねー。 というわけで、以下のブックマークレットを実行してあげてください。javascript:void(XPathRe

参考: http://d.hatena.ne.jp/mofigan/20070727/1185463261 var SITEINFO = [ { url: 'http://.*amazon.co.+/gp/(best|move)', nextLink: '//td[@class="paginationCurPage"]/following-sibling::td[position()=2]/a', insertBefore: '//div[@class="list"]/following-sibling::node()', pageElement: '//div[@class="list"]', }, ] こんな感じに、まずはautopagerize.user.jsを修正して実験できる。 C:\Documents and Settings\eto\Application Data\Mozi
What is jQuery? jQuery is a fast, small, and feature-richJavaScript library.It makes things likeHTML document traversal and manipulation, event handling,animation, and Ajax muchsimpler with an easy-to-useAPI that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people writeJavaScript.
1リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く