dom

GWT wrap() method iterates whole DOM unnecessarily?

I'm using a custom GWT component that wraps around an existing textbox in my html page. The page returns a list of information - so as larger sets of information are loaded - the GWT loading process takes longer and longer. Looking at the source code of the wrap() method - it appears it iterates through the DOM looking for matching i...

Python xml.dom and bad XML

I'm trying to extract some data from various HTML pages using a python program. Unfortunately, some of these pages contain user-entered data which occasionally has "slight" errors - namely tag mismatching. Is there a good way to have python's xml.dom try to correct errors or something of the sort? Alternatively, is there a better way to...

IE7 "Operation Aborted" even with FastInit!?

A piece of javascript code I'm working on is causing the nasty "Operation Aborted" message in IE. I am well aware that you cannot modify the DOM until after it has loaded. Sure enough the line of javascript code causing the error is the one which appends a new div tag to the body. However the function which the line is located within is ...

Four variations of jQuery ready() -- what's the difference?

I've seen four different ways to tell jQuery to execute a function when the document is ready. Are these all equivalent? $(document).ready(function () { alert('$(document).ready()'); }); $().ready(function () { alert('$().ready()'); }); $(function () { alert('$()'); }); jQuery(function ($) { alert('jQuery()'); }); ...

Is there a tool that can record Internet Explorer DOM events and record them into XML or TXT?

This tool have to record all (or filtred) DOM events of Internet Explorer and allow to record them into an XML File or a Text file. ...

Detect click outside element?

Similar to this question, but taking it a step further. I would like to detect clicks outside of a set of items, which I am handling in the following way: $('#menu div').live('click', function() { // Close other open menu items, if any. // Toggle the clicked menu item. $('body').one('click', function(event) { // Hi...

How would I bind this to the onclick event in JQUERY?

I have the following which i use in a traditional onclick event for a DIV tag How would I go about implementing this using jquery? $parameter = "onClick=\"selprice('" . $price_options_array[$price_counter]['price'] . "','" . $price_counter . "')" . "\""; I use the above and just add it to my div like so: <div class="price_row" <...

How can I get a reference to a node directly after it is appended?

I have a situation where I'm appending a node inside an element and would like a reference to it right away. At the moment I do something along these lines: var children = $("#elem").append("<p>hello</p>").children(); var current = children[children.length -1] Can this be done more cleanly with jQuery? I know, I can write a helper...

Trying to append to an element using js?

I am trying to add to all <object>'s on a page a snippet of html. I understand I can access elements by tag name and that I can change the element, but can I simple append to it instead? In addition, I want to add it to the contents of each tag, not the end of the document. Which of these methods will work? ...

jQuery, string manipulation : find a tag

After a post with "$.ajax()", I sometimes receive an exception from the server. You can see a part of the returned HTML below: <html> <head> <title>MyMessage</title> <style> /* ... */ </style> </head> <body bgcolor="white"> <span> <H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1> <h2> <i...

removing and appending a node

I want to remove below span elements from the div (<div id='foo'>) and append newly created nodes instead each of them. I am using a loop to traverse all the children of the div, and for each node found I am removing it with removeChild and append an newly created node. I am getting o/p as <div id='foo'> <SPAN>new text</SPAN> </di...

How to access DOM of a web page in QtWebKit?

How to access DOM of a web page in QtWebKit? I don't see any methods exposing DOM in QtWebKit... ...

How to guess browser compatibility based upon DOM Level?

Is there a simple rule-of-thumb to know approximately which browser versions and upward will be compatible with a given DOM level? ...

JavaScript scrollTo method does nothing?

Hey all.. So I am desperatley trying to get some scrolling functionality to work on a page. After not having a luck I decide to just stick window.scrollTo(0, 800); on my page to see if I could get any scrolling to happen. Nothing does happen. I have an accordion that expands and then I want to scroll to a specific element with in it. Bu...

Get the width of a DOM element?

Is there a way of accessing the width of a DOM element? In particular, I'm looking to get the width of a table cell (td) who's width can be of varying lengths based on the length of the text in that cell. ideally, the solution I'm looking for will use the jQuery library, but others will work as well. Also, I must stress that the solut...

jQuery/XML: synchronizing data and representations using DOM-Mutation-Events

Hi, I'm creating a web application which uses jQuery to modify and HTML to represent the data. There can be several representations in the document related to a single data node. The user can dynamically create them. For example, data will be represented and can be modified in tables. Additionally the user has the opinion to extend a "q...

Replacing a html tag with another tag using JS DOM

Hi everybody, I am fairly new to javascript and DOM and I am having a problem with manipulating DOM using javascript for the following html code. <html> <head> <title>Testing</title> </head> <body> <marquee direction=up height=400 scrollAmount=3.7 scrollDelay=70 onmousedown="this.stop()" onmouseover="this.stop()" onmousemove...

How to incoparate or implement a DOM API to v8?

I am writing a server application that is able to manipulate the DOM before it is served to the client. I am using C++ and Google's v8 as a javascript engine but I don't see any DOM API in v8. Is there an open source implementation for doing DOM manipulation on HTML? If not how would you implement one? ...

How to determine a 'line-height' using Javascript (jQuery)?

Well, encountered the need of a line-height coding a plugin, so, can you give an advice, please? Thanks) ...

Why does Ext JS 3.0 break my grid filter input field?

Here's a snippet of code, inserted immediately after creating my grid, that worked fine under 2.0: var gridFilter = Ext.get(gridToolbar.addDom({ tag: "input", type: "text", size: "25", value: "", cls: "x-grid-filter"}).el); gridFilter.on("focus", function(){this.dom.select();}); Now, I get a JavaScript error on the...