dom

What is the difference between a Node and an Element in XML

Possible Duplicate: Whats the difference between an element and a node in XML? Having been writing Code that operates on XML for a while, I have always wondered what is the reason for having both Nodes and Elements? Both of them represent tags (more or less) and having different methods, just makes the code complicated. Are t...

Changing HTML into DOM.

Is in Java (sic!) any function which could change HTML placed in string into DOM Tree? ...

not able to get any results or printout while fetching attribute from xml node using dom object in php

here's an example of the ticketcity.xml file im using: <Events Version="3.0" Method="GetEvents" StatusCode="0" StatusMsg="Success"> − <Event ID="569402" Name="Hair" SeatingChart="http://www.ticketcity.com/images/seatingcharts/MARTINBECK_THEATRE_NYC.GIF" Page="http://www.ticketcity.com/theatre-tickets/broadway-tickets/hair-ticket...

Downsides to Hiding Flash under Overlaying DIVs

Does anyone know of any harm in hiding flash elements that collide with an overlaying DIV? By hiding I mean setting the css visibility to hidden. I understand that it requires a DOM traversal to look for objects and embeds which causes some overhead, but are there any other reasons why people don't do this? This is for sites that don't...

Why the subtle cross-browser differences in Event Object.

The following declaration at the window level: var event; // for IE var event = "anything"; // for Chrome will destroy the event object as used here: <div onMouseOver = "alert(event.type);">Mouseover Div</div> Firefox does not seem phased by either declaration. I realize that declaring a variable with the name "eve...

jQuery - Trigger event when an element is removed from the DOM

Hi - I'm trying to figure out how to execute some js code when an element is removed from the page: jQuery('#some-element').remove(); // remove some element from the page /* need to figure out how to independently detect the above happened */ is there an event tailored for that, something like: jQuery('#some-element').onremoval( func...

Best way to add DOM elements with jQuery

So I've seen three ways to add html/DOM elements to a page. I'm curious what the pros and cons are for each of them. 1 - Traditional JavaScript I beleive the strait JS way to do it is by constructing each element, setting attributes, and then appending them. Example: var myRow = document.createElement("tr"); myRow.class = "myClass...

jQuery new element appended to DOM does not work

I have a script that selects and drags several elements. It works fine but when I want to add another new element to that function, append it to DOM, it does not work. The function is: $(function() { var selected = $([]), offset = {top:0, left:0}; $("#selectable1").selectable(); $("#selectable1 span").draggable(...

jquery append element from string + do not close tags properly

Hello, I have the following string elements that i want to append to the DOM, but in IE the tags do no close. Example: $("#accordion").append('<div id="mydiv" class="sortme">bla bla bla</div><div id="panel" class="accordionPanel"></div>'); After IE render it the div elements for instance are rendered without closing tag. It was suppo...

jQuery convert DOM element to different type

I need to convert a DOM element to a different type (as in HTML tag name, a to p in this case), but still retain all the original elements attributes. Whether they are valid for the new type or not doesn't matter in this case. Any suggestions on how to do this? I've looked at just creating a new element and copying the attributes acros...

Not getting the Tag's nodeValue using DOMDocument class in PHP?

i am using DOMDocument class, to parse HTML document in PHP. the code of table i am using... <table> <tr> <td> 123 employees </td> </tr> <tr> <td> $50,000 </td> </tr> </table> i am not able to fetch nodeValue of the tag, which are like in the above format, i.e ($50,000, 123 employees ). ...

Stopping a iframe from loading a page using javascript

Hi, Is there a way in javascript of stopping an iframe in the middle of loading a page? The reason I need to do this is I have a background iframe streaming data from a web server (via a Comet style mechanism) and I need to be able to sever the connection at will. Any ideas welcome. ...

getElementsByTagName problem in chrome and safari

I`m parsing a Google Maps RSS with javascript and using the following code to get the point coordinates: point_coords = items.getElementsByTagName('georss:point') Unfortunately it works in FF but not in safari and chrome (still not tested in Opera and IE) The XML looks like: <item> <guid isPermaLink="false">guidNo</guid> <pu...

android xml to file

The javax.xml.transform package is not included in the Android SDK, so how to write a dom doc to a file? ...

How can I change the style of the document via JavaScript?

That would go like this * {margin:0; padding:0;} in CSS. ...

What is the difference between Browser Object Model vs Document Object Model

What is the difference between the two? Can someone explain, thx. ...

Overflow hidden elements

I'm wondering how can I access overflowing elements. I would like to copy their content in to another div or something. Lets say I got a ul with 5 li elements, but only two are visible. So.. How can I get other 3 elements in another div? ...

Constantly running javascript?

How can I have my javascript code constantly run? The situation is that I want some page elements to be resized when the page resizes. I'm thinking that the way to do this would be to have some javascript code that constantly runs, and whenever the page size changes, it resizes that element. I tried doing this with setTimeout() and a rea...

How can I solve this exercise?

This is xml code and I want to write code with javascript using DOM to get the father, mother, daughter and son names ------->(ali,mona,ghada and mohamed) Can any one help me? <family> <grandfather>Ibrahim <father job="Engineer">Ali <mother>mona</mother> <daughter age="23" job="ITI stud...

1 million link elements in one page?

will it get "laggy" if i fetch 1 million link elements and put it in the DOM. cause i want a navigation list on top..its kinda like the one Apple's got on their site and you can scroll left or right with your keyboard. the only difference is that the center image will be get larger in size compared to the others. the link elements will...