dom

<iframe> javascript access parent DOM across domains?

I control the content of an iframe which is embedded in a page from another domain. Is there any way for javascript in my iframe to make changes to the parent's DOM? For example, I would like to have my iframed script add a bunch of html elements to the parent DOM. This seems like a pretty tall order - thoughts? Edit: There exists a t...

Change Parent Window onclick Value From Child Window Via JavaScript

Setup: I'm opening a new window via js that is a classic asp page with one form (yes, classic asp, I know). That form posts to a processing page where I Response.Write() some inline js to manipulate form elements on the parent page like so. .Write ("<script language=""javascript"">" & vbcrlf) .Write ("var stopButton = opener.docum...

Browser detection versus feature detection

I’m going to play a devil's advocate for moment. I have been always wondering why browser detection (as opposed to feature detection) is considered to be a flat out a bad practise. If I test a certain version of certain browser and confirm that that certain functionality behaves is some predicable way then it seems OK to special case it....

Getting DOM tree of XML document

Does anyone know how I would get a DOM instance (tree) of an XML file in Python. I am trying to compare two XML documents to eachother that may have elements and attributes in different order. How would I do this? ...

Java DOM XML is skipping xmlns properties

Hi there, I need to generate an xml file in Java, so I chose to use DOM (until there everything is ok), here is the root tag of what i need to create <?xml version="1.0" encoding="utf-8"?> <KeyContainer Version="1.0" xmlns="urn:ietf:params:xml:ns:keyprov:pskc:1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xenc="http://www.w3.o...

traversing dom in jquery?

I have code similar to the following: <div class="class1"> <a class="link1" src="...">...</a> </div> <div class="class2"> <a class="link2" src="...">...</a> </div> Assuming I am currently in the click event for class link2, how do do I get the src value of the link1 hyperlink? These are dynamically generated so there may be m...

how does jQuery implement get elements by class name?

There is no such a "getElementsByClass" function in javascript, then how does jQuery manage to do that? Looping all elements will be too less efficient. BTW,how to specify css to elements with two or more classes? <a class="one two">test</a> Guessing like below? .one.two {...} Is that right? ...

traversing dom in jquery find previous instance of class

I have the following repeating pattern of tables and buttons ---------------------- table 1 .inventory class ---------------------- [button 1 .add-row] ---------------------- table 2 .inventory class ---------------------- [button 2 .add-row] ---------------------- table 3 .inventory class ---------------------- [button 3 .add-row] ...

Software for building DOM/CSS-class references

I am currently setting CSS class names in a quite large browser-based application. I started sketching out the HTML element layout (basically a large set of nested boxes) on paper, and writing down the CSS style name next to each box. This is of course very tedious, and I started to realize that this would be very useful in the applica...

getting current document address (firefox extension)

Hello, does anybody know, how to get URI of current page/tab? ...

Unobtrusively swapping HTML by XMLHttpRequest

So, I have received a string of HTML from the server using Javascript. It should be relatively well formed, but each node does not necessarily have a common ancestor. Ex. Response: <li>Item 1</li> <li>Item 2</li> ... The purpose here is to replace HTML currently on the page with the HTML received from the server without requiring an i...

JavaScript: Can a constructor function create a documentElement object?

I want to make a constructor function that creates a documentElement object. As an example, consider the new Audio() constructor - it creates a documentElement object, and if you pass it some variables it populates the new documentElement with attributes. It doesn't insert it into the DOM, it simply creates the object. So, the questio...

Generate XML with namespace URI in PHP

Ho to make this "simple" xml with php using DOM? Full code will be welcomed. <rss version="2.0" xmlns:wp="http://url.com" xmlns:dc="http://url2.com" > <channel> <items> <sometags></sometags> <wp:status></wp:status> </items> </channel> </rss> i'm so lost. Code will help me more than any explanation. ...

Xerces C++ 2.8 trying to modify a DOMDocument and getting DOM Exception: An attempt is made to reference a node in a context where it does not exist

Hello, I am new to this site so I apologize in advance. I am trying to modify an XML document using Xerces C 2.8. I'm somewhat familiar with Xercess though not proficient with it. What I am trying to do is: 1. make a function that will take a search node string and an insert node string, 2. parse a document and gather all searchnode ...

Unloading/Removing content from an iFrame

Is there anyway to unload a page that has been loaded inside of an iframe? I do not want to have to change the iframe src to a blank page if possible. I am basically looking for something that will do something like this $('#frameID').attr("src",""); except that code does not seem to clear the previously loaded page. Is there a "unload"...

JavaScript: DOM load events, execution sequence, and $(document).ready()

I just realized that I lack the fundamental knowledge of what exactly happens as a page is being loaded into a browser. Assume I have a structure like this: <head> <script src="jquery.js" type="text/javascript"></script> <script src="first.js" type="text/javascript"></script> </head> <body> ... <script type="text/javascript" id="midd...

How do I get the text of a radio button (not the value)

I know I can get the "value" attribute of a radiobutton but I'm finding it strangely difficult to get the text of the radiobutton. Consider the example below. It has 3 radiobuttons and tries to alert the value of the first radio button, which is "red" and then trys to alert the value of the radiobutton, "apple" but that fails. Getting...

Efficient XSLT pipeline in Java (or redirecting Results to Sources)

I have a series of XSL 2.0 stylesheets that feed into each other, i.e. the output of stylesheet A feeds B feeds C. What is the most efficient way of doing this? The question rephrased is: how can one efficiently route the output of one transformation into another. Here's my first attempt: @Override public void transform(Source data, ...

How can I get the font size of an element as it was set by css

I'm writing a simple jQuery that to change the font size of an element by a certain percentage. The problem I'm having is that when I get the size with jQuery's $('#el').css('font-size') it always returns a pixel value, even when set with em's. When I use Javscript's el.style.font-size property, it won't return a value until one has been...

How can I change the namespace on every node in a DOM?

How can I, given a w3c DOM (Java's default implementation, specifically) change the namespace of every element/attribute/node in that DOM? Efficiently, preferably. The DOM doesn't seem to have a setNamespaceURI method on it, which is inconvenient. I've tried XSL approaches, but they've failed to work in the JAXP transformers (although...