Hi,
I have a node that I'm note sure is an element (from calling node.previousSibling). However I am having trouble finding out the cross browser javascript way to access the Node constants shown on the MDC.
In all browsers but IE Node.ELEMENT_NODE is defined. I tried using a specific instance of node, e.g.:
e=$("#element_id")[0];
ale...
I am using jQuery 1.3.2, and I'm trying to select some elements in an svg DOM element.
$('svg > defs > lineargradient')
However for some reason it does not select it, I know that I can access other items in the <svg> element since I have successfully retrieved an $("svg > rect").
My SVG DOM looks like this:
<svg width="975" height="...
Hey all,
I was just wondering if there is a clean implementation to getting elements before appending them to the DOM.
Example (w/ jQuery):
var html = "<div class = 'test'><div class = 'innertest'>Hello!</div></div>";
var innerDiv = $(html).find('.innertest');
I feel like its not possible, but I'd like to see if there is any impl...
need a simply preg_match, which will find "c.aspx" (without quotes) in the content if it finds, it will return the whole url. As a example
$content = '<div>[4]<a href="/m/c.aspx?mt=01_9310ba801f1255e02e411d8a7ed53ef95235165ee4fb0226f9644d439c11039f%7c8acc31aea5ad3998&n=783622212">New message</a><br/>';
now it should preg_match "c....
I have a webpage where there is a texarea within a iframe. I need to read the value of this textarea from its child page javascript. Presently by using window.parent.getelementbyID().value in the javascript, I am able to fetch values of all controls in the parent page except the textarea within the iframe.
The frame id n frame name in my...
I have a HTML comment outside of the DOM root node which I need to read:
<html>
... other stuff
</html>
<!-- The comment I want to read -->
Can I do this with JavaScript somehow?
...
I'm messing around with some jQuery stuff for a mockup and noticed some odd behavior. I'm hoping someone here can shed some light on it.
This is all mockup / test code, so please excuse the sloppyness.
So I have a table that I'm using in conjunction with the jQuery datatable plugin:
http://www.datatables.net/
My table markup is as...
Hi,
Is there a way to get the bounding rect of a text node?
The getBoundingClientRect() method is defined on elements only, and the parent element is bigger then the actual text node.
10x!
...
Hello
I have the following code to retrieve all hyper links in an HTML document
and my question is how to retrieve the text nodes inside every anchor tag
(even if the text node is a child of a child like if the anchor node has a span node which has a text node)?
<?PHP
$content = "
<html>
...
My GWT application creates text areas, each of which must have an ID in order to be useful to a third-party JavaScript library. I know how to assign an ID to a GWT widget; I'm after a good way of generating those unique ID's.
...
I'm writing a script which reads and manipulates a KML (xml) document. Below is a snippet of the document I'm reading:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by Feature Manipulation Engine 2009 (Build 5658) -->
<kml xmlns="http://earth.google.com/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
...
//create an instance of the XML parser
if (window.ActiveXObject)
{
//Checking if the browser is IE
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false"; //make sure doc is fully loaded
xmlDoc.load(strPath) //load the file in the parser
if (xmlDoc.parseError.errorCode != 0)
{
alert("Error #: ...
Hello SO:
I have this javascript that adds a form field, along with a link to remove that field:
var fieldCount = 0;
function addField() {
var name = 'file' + fieldCount;
var row = 'row' + fieldCount;
var str = '<p id="' + row + '"><label for="' + name + '">File to upload: <input type="file" name="' + name + '" id="' + name...
I'm looking for a way to select all elements on a page, except those with a specified DOM location.. Here's an example of what I'd like to do:
jQuery('*').except('.ignore').bind('click', function(e) { ... });
Is this possible in a "native jQuery" way?
...
I understand how to create XML in Groovy using MarkupBuilder. How do you add/insert elements into a MarkupBuilder object after the initial creation? For example, start with:
def builder = new MarkupBuilder(writer)
def items = builder.items{
item(name: "book")
}
Which would produce:
<items>
<item name="book/>
</it...
document.getElementById('logbox').scrollTop =
document.getElementById('logbox').scrollHeight;
I tried $('#logbox').scrollTop but there is not this attribute.
How to access DOM attribute through jQuery object?
...
I've got a little problem: I don't know whether it is possible to select all DOM nodes with some attribute patterns using jQuery.
For example, I need to select all nodes with id attribute set to a string starting with "_dom".
I've found something like this:
$("input[name^='news']").val("news here!");
but as far as I can see, this c...
Hi.
I want to store some data from structures like this:
class Project {
ChildA a;
ChildB b;
}
class ChildA {
ChildC c;
...
}
...
I have created data like:
Projet x = new Project();
x.a = new ChildA();
x.a.c = new ChildC();
... and I want to save it to an external file on the sdcard of my device so that other apps...
Hello,
I am scraping some data and I want to get the the value of an element after a specific tag with value.
It's a bold tag with value 'Types:'.
<b>Types:</b>
Once I get to that element I can use Prototype's Element.next() to get the data I want.
How exactly do I do this?
I have been fiddling with $$ but can't seem to get it righ...