I'm trying to write a bookmarklet that calls the function doSomething(textNode) on all instances of visible text on the document.   doSomething(), just for fun, replaces every word with "derp" by replacing the textContent of the textNode...
I've discovered that I have a need for selectors with full support for DOM textNodes that jQuery doesn't provide.  jQuery ignores text nodes, probably because most pages have tons of irrelevant blank ones between tags that the various browser...
I have the following code which seems to work fine in all browsers except IE8 and below.  $("table.availability").each( function() {     var siteName = $(this).parent().siblings("h2").contents().filter(function() { return this.nodeTyp...
i have some dynamically generated html from a php script. the php code looks like this  echo "<div id='categories'>\n"; foreach($category as $k => $v) { echo "<div class='category'>\n"; echo "<div...
I get the user selected text:  var selection = window.getSelection(); var selectRange = selection.getRangeAt(0);  var content = range.cloneContents(); // DocumentFragment   How can I get the textNode in the DocumentFragment content?...
Following that discussion, I'd like to understand how to use TreeWalker to change text on textNodes filtered by class names.  I'd like to replace all numbers with "x" on <p class="french"> only.  There's a piece of s...
I am curently working on one visualization, using JavaScript, which should deal with large amount of text. In each sentence there are at least couple of words which I need to color, which means that a single sentence would look something like that:...
I'm a bit rusty on my jQuery (been a few years!) I have to assume this has been asked 100 times but I'm not searching for the right terms it seems.  I'm trying to grab all of the descendant text nodes of an object, and then, if there'...
I am trying to get the closest parent element of the selected text, it works if the selected text hasn't been replaced, but it fails after the text replacement.  Here is the code (I modified from other source):  jQuery(document).ready(function($)...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.