dom

IE: Undocumented "cache" attribute defined for input elements?

Hi everybody. I've stumpled upon a strange behavior in IE(6/7/8) that drives me nuts. Given the following markup: <input type="text" value="foo" class="bar" cache="yes" send="no" /> Please note that the cache attribute is set to yes. However IE somehow manages to change the attributes value to cache="cache" when rendering the DOM. S...

Why does this odd CSS confuse the DOM parsers of IE 7 and Opera 10?

This is a weird CSS issue I was experiencing while trying to fix a footer that rendered properly in IE 6 but failed to render properly in IE 7. Here's what the issue was. There is this css class, clearer, shown below: .clearer { clear: left; line-height: 0; height: 0; } In the JSP/HTML output, there were either: <div ...

Dynamically create an element in google desktop

How can I dynamically create elements, like labels and such, using the google desktop API? Put differently, how can I duplicate the browser's: document.createElement('br'); ...

Check if an object is an element on google desktop

In javascript on a browser, I can do this to see if an object is DOM-related: obj instanceof Node How do I accomplish this with google desktop? Node is undefined, and this doesn't work either: obj instanceof basicElement ...

Can't appendChild to a node created from another frame

I have a page with an iframe and would like to extract a DOM node from the child frame and put it on the parent page. This works in Firefox (3.5), but not in Internet Explorer (7). I've broken down the code to the simplest I can. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict...

Assign javascript function to a dom element

hi, i'm using the mshtml library for parsing out html via MSHTML.HTMLDocument. my question: is there a way to assign a javascript function to a dom element? i've tried something like: div.onmouseover = "function(){alert('mouseover')}" and div.setattribute "onmouseover" , "function(){alert('mouseover')}" without success (no error ...

jquery remove last created element

I need some help with removing some elements from my page with jQuery, currently I have PHP loop that builds links, <?php $findMore = array(); $i = 0; foreach ($backgrounds as $row) : ?> <a id="<?=$i;?>" class="findOutMore" href="<?=$row['backgroundAddress']; ?>">Find Out More</a> <?php $i++; endforeach; ?> ...

Inserting many DOM elements chokes

I've got a loop where I insert about 500 <div>s into the DOM via document.getElementById(target).appendChild(docFragmentDiv), and each <div> has probably 20 or 30 descendants. I can insert up to about 100 just fine, but the page temporarily freezes while the DOM is updated if there's something like 200+ inserts. How can I avoid this cho...

A good book for PHP XML DOM

Unfortunately the PHP DOM classes and functions are not very well documented and I am starting projects that are going to be very XML heavy. I do not have a solid grasp on the DOM functionality and have been making due with SimpleXML abd XMLWriter untill now, but I am running into some serious problems with their limitations. Is there ...

What is DomHelper in google closure?

Could somebody explain what is the meaning of DomHelper in google closure? What is it for and how it may be useful? Thanks! edit: Here is a more detailed answer ...

Javascript: What argument does the function specified in body's onload event get called with?

Similar to this question, my HTML looks like this: <body id="body" onload="loader()"> </body> I always assume, as this doc says, that onload is given no arguments. However, I named the argument, and did some deep inspection, and found that I got an object looking like this: {originalTarget : DOM, preventCapture : function, target :...

How can I have multiple document.observe(dom:loaded ...) functions inside one javascript file? (prototype)

Hi, Basically what I'm after is, following squashing all my JavaScript into one file (or a few files) how can I make a document.observe(dom:loaded({...})) function call for the right page? So, say I have 5 pages in my website, and each one has a separate JS file. Inside each file is a load of page related functions, and a special funct...

XQuery execution without a software

How can we execute Xquery embedded inside Html or with a reference to an xquery document within html? is there a JavaScript method ? or ASP DOM method ? ...

How do I apply events to dynamicly loaded DOM nodes with JQuery?

I'm using AHAH to load a piece of HTML after the document is ready. There's a button in that chunk of HTML I would like to apply a .click event to. I'm having trouble applying that event after the HTML is loaded. The call back is very generic and is used by other parts of the page so I would prefer not to fill it up with specific code. A...

How do I overcome IE8 getting "stuck" in SCORM 4th Edition Compliance Test SX-05?

I am posting this in the off chance there is a SCORM expert out there that may have seen something similar. Internet Explorer 8 gets "stuck" on step 14 of test case SX-05. Something doesn't trigger the continue. No amount of debugging and tracing reveals anything. It's as if the test case is "overwhelming" IE8's slow JavaScript engine. ...

Javascript subclassing and createElement

Hello. function A() { this.myProp = document.createElement("div"); } function B(id) { this.myProp.id = id; document.body.appendChild(this.myProp); } B.prototype = new A(); window.onload = function() { new B("hello"); new B("goodbye"); } What happens here is that I end up with one div with id "goodbye". What I wo...

HTML selection option with javascript doesn't work in IE

hallo, can somebody help me. I try to make some thing happen when i click on anders(value 0), than something need to be vissible. It works in firefox but not in IE <select id="budget" name="budget"> <option value="0" onclick="anders('1')">Anders</option> <option value="200" onclick="anders('');" selected="selected">&#8364; 200,-</option...

How to serialize DOM node to JSON?

I want to serialize DOM node or even whole window to JSON. For example: >> serialize(document) -> { "URL": "http://stackoverflow.com/posts/2303713", "body": { "aLink": "", "attributes": [ "getNamedItem": "function getNamedItem() { [native code] }", ... ], ... "ownerDocument": "#" // recursive link he...

jQuery onclick pass post variables and reload page.

Can I pass post variables and reload a page on clicking an hyperlink? To be clear I have something like this. <a href="test.php?name=test">Click</a> If javascript is enabled, I think I can use "event.preventDefault()" to suppress passing as GET variable. So now onclick, name should be passed as post variable instead of get. If jav...

"innerHTML += ..." vs "appendChild(txtNode)"

The question is, comparing concatination using innerHTML and appending a text node to an existing node. What is happening behind the scene? My thoughs around this so far: I'm guessing both are causing a 'ReFlow'. The later, from what I know, also causes a complete rebuild of the DOM (correct? Are they both doing this?). The former see...