dom

What does JQuery do to a <div> when you set it to hide?

I was wondering what JQuery actually does to a <div> when you set it to hide? Does it simply set it's CSS display style to none? The reason i ask, i wanted to set a <div> to be hidden initially (by setting the property manually, not by calling .hide) then use .show() to bring it into view when needed. Cheers, Kohan ...

Simple html vs Javascript generated html?

In my web application I would like to complately avoid html and use only javascript to create web-page's dom tree. What is faster writing web content in the traditional way in html <div>Some text</div> or using javascript dom render, like this: div.appendChild(document.createTextNode("Some text"));? ...

Work with AJAX response with DOM methods

I'm retrieving an entire HTML document via AJAX - and that works fine. But I need to extract certain parts of that document and do things with them. Using a framework (jquery, mootools, etc) is not an option. The only solution I can think of is to grab the body of the HTML document with a regex (yes, I know, terrible) ie. <body>(.*)</...

How to dynamically populate a dropdown from a text box

I have a form where the user has to enter a list of choices into a series of text boxes: for example: Enter speaker name 1: [ ] [] remove speaker Enter speaker name 2: [ ] [] remove speaker Enter speaker name 3: [ ] [] remove speaker Based on what the user enters here, another drop down has to be populated on the ...

document.createElement() creates unclosed tag?

This happens in Firefox, but not in Google Chrome. I create an SVG 'Image' tag in an svg-web canvas like this: im = document.createElementNS(svgns, 'image'); im.setAttributeNS(xlinkns, 'href', g.href); canvas.appendChild(im); And if I look in firebug or chrome's debugger, the svg shows up self-closed like this: <image xlink:href=".....

PHP Dom problem, how to insert html code in a particular div

I am trying to replace the html code inside the div 'resultsContainer' with the html of $response. The result of my unsuccessful code is that the contents of 'resultsContainer' remain and the html of $response shows up on screen as text rather than being parsed as html. Finally, I would like to inject the content of $response inside 'r...

Java+DOM: How do I convert a DOM tree without namespaces to a namespace-aware DOM tree?

Hello, everyone! I receive a Document (DOM tree) from a certain API (not in JDK). Sadly, this Document is not namespace-aware. As far as I know DOM, once generated, namespace-awareness can't be "added" afterwards. When converting this Document using a Transformer to a string, the XML is correct. Elements have xmlns:... attributes and n...

Obtaining a Reference do the Script's Parent Element

Hi, I am using AJAX to return a response which includes a script. Through that script, how can I determine the ID of the parent element the script is running in without passing id's to the server? Is there a way? Thanks. ...

Get the string representation of a jquery DOM object's entire HTML

Hi, I have had a bit of a look around and am having some difficulty solving a wee issue I am having. I basically have a string of HTML, I convert that to a JQuery DOM object so that I can easily remove all elements that have a certain class using JQuery's .remove(). I.e., var radHtml = editor.get_html(); var jqDom = $(radHtml); $("....

mootools changing an elements inline css

I have some HTML that looks like this, <div id="mb_contents" style="visibility: visible; opacity: 1; width: 600px; height: 450px;"> I am trying to turn the visibilty to hidden using this js/mootools, $('mb_overlay').set('styles', { 'visibilty': 'hidden', }); However nothing seems to be working, am I missing som...

Moving an element to the body using jQuery

How can I move an element to the end of the body? Using jQuery, I want some given element to be moved to the body, preferably to be the last element contained by it. Imagine the following would be valid: $('#myElement').moveToTheEndOfTheBody(); Thanks! ...

How can I know if an element is a direct child of the body using jQuery

I want to perform some action on elements that are not direct child of the body. How can I check a particular element to know whether its partent is the body. Thanks! ...

DOM + need to remove element from XML bt VB script

I have the following VB script , I want to remove the "NET2 ID" element from name list how to remove the NET2 ID element , need first to verify if NET2 defined and then to delete it THX Set objXMLDoc = CreateObject("Microsoft.XMLDOM") objXMLDoc.async = False objXMLDoc.load("\\dir\d.xml") Set objRoot = objXMLDoc.documentElement Set ...

Does remove a DOM object (in Javascript) will cause Memory leak if it has event attached?

So, if in the javascript, I create a DOM object in the HTML page, and attach event listener to the DOM object, upon I remove the the DOM from HTML page, does the event listener still exist and causing memory leak? function myTest() { var obj = document.createElement('div'); obj.addEventListener('click', function() {alert('wh...

XML + DOM + replace text in element

from XML <NET ID="10.10.10.10, 255.255.255.0" /> I need to replace the text 10.10.10.10, 255.255.255.0 with 192.9.1.1, 255.0.0.0 by VB + DOM script so the final line in the XML should be <NET ID="192.9.1.1, 255.0.0.0" /> THX ...

jQuery .each() returns DOM element and not a jQuery object

I could be misunderstanding what is happening but from what I can tell I am getting a DOM element and not a jQuery object when I use .each(). The below will not work as this refers to a DOM element and not a jQuery object $("span[id$='_TotalItemCost']").each(function() { var someText = this.text(); }); Modified to transform this ...

Colour manipulation of custom tags in niceEdit HTML editor ( JS / DOM )

Hi, I would like to be able to highlight, during typing and in real time, certain custom tags in the format #tag_name# within the text of a nicEdit instance ( http://nicedit.com/ ). My current attempt to implement as close to this as possible revolves around using the blur event of the editor to highlight the tags once the editor loses...

Hudson XML error-- No module named dom.minidom

I am trying to send a simple XML file of the format given in http://wiki.hudson-ci.org/display/HUDSON/Monitoring+external+jobs . I was able to send it easily and was getting desired result!! Then I tried to build this XML file using python script and it was giving me the exact file that I wanted without any problem. But when I tried to r...

Finding a particular parent of an HTML DOM element

Lets say I have the following: <table><tr><td> <table> <!-- I want a reference to this table --> <tr> <td> <table> <tr><td><span class="theSpanClass"></span></td></tr> </table> </td> </tr> </table> </td></tr></table> Using jQuery, I'd ...

Adding HTML object to DOM using JavaScript. Showing blank.

Hi, I'm attempting to creat a HTML button using JavaScript (seemingly simple), yet for some reason the object isn't being placed on the page. Do I need to append it to the DOM or somehow create an instance of it? Here is my code: function loadNavigation() { var backButton; backButton = document.createElement('input'); backButton.ID =...