dom

Creating a DOM NodeList

I'm implementing all of the optional E4X features described in ECMA-357 Annex A and I'm having trouble implementing domNodeList (§A.1.2 and §A.2.2). How would I create my own NodeList object? Even if I create a new XMLDocument and append every domNode() representation of the nodes in an XMLList, I still don't see how I could create a No...

document.commandDispatcher "offiocial" documentation?

How come commandDispatcher is not listed as one of document's properties in Mozilla documentation? It's mentioned in XUL tutorial, for instance, but I can't find it in the official document's properties list, or in W3C's DOM Core or HTMLdocument specification for that matter. Please help. ...

C#: Accessing and Modifying Values in a WebBrowser Control

I have a WebBrowser control where I want to edit a field in the HTML and then submit a form. Let's say that the field is called txtUname and that the submit button is called submit in form form1. How can I do this? I'm currently thinking of using something like this, but I haven't tested it: //Change value webBrowser1.Document.getElem...

UserScript: run JS on password fields as they're loaded

I want to write a user script that runs some custom JS on each <input type="password"> field that gets loaded. I could register an event handler on document load to look for all input fields and run the JS on them, but that means firstly that the JS won't run on input fields that subsequently get added by other JS, and secondly it won't ...

I try to add a new button to Firefox, but it's the old button that gets added!

Once, I tried adding a button with "bookmark-item pagerank" as class to PersonalToolbar. Now, the code... function createToolbarButton() { const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var anitem = document.createElementNS(XUL_NS, "toolbarbutton"); anitem.setAttribute("id", "Testing-Doit-But...

Php HTML DOM parsing.

<table width="100%" cellspacing="0" cellpadding="0" border="0" id="Table4"> <tbody> <tr> <td valign="top" class="tx-strong-dgrey"> <a class="anc-noul" href="http://www.example.com/catalog/proddetail.asp?logon=&amp;amp;langid=EN&amp;amp;sku_id=0665000FS10129471&amp;amp;catid=25653"&gt; Apple 8GB 3rd Generatio...

Execute javascript after external javascript document has loaded

Hi guys, I want to include a remote js file and then invoke a function once that has finished executing. I thought I could do something like this: var sc = document.createElement('script'); sc.setAttribute('type', 'text/javascript'); sc.setAttribute('src', src); sc.innerHTML = "alert('testing');" parentNode.appendChild(sc); Turns out...

using JavaScript to insert a lot of html content into a document

I have many many lines of HTML content that I need to insert into a document using JavaScript. What the best way to do this? I don't want to have it broken out line by line in the source code, and not all stuffed together in a string. ...

Javascript doesn't work in IE8

I am trying to create this html elements dynamically on the onload of my page,however;when I run it the code wont work on IE8 but okay in firefox,safari,and others. function getmovie() { var container = document.getElementById("container"); if (!container) return; var object = document.cr...

Getting content of a div (including child tags) with DOM

Hi, i am using DOM to get content of div tag but inner html part is not shown. Function is: $dom = new DOMDocument; libxml_use_internal_errors(true); $dom->loadHTMLFile("$url"); libxml_use_internal_errors(false); $xpath = new DOMXPath($dom); $divTag = $xpath->query('//div[@id="post"]'); foreach ($divTag as $val) { echo $val->getAttribut...

Help me to take value from Web Service using DOM parser

I have 2 table. Table A has ID (int, auto_increase), Name (Varchar), City_ForeignKey (Int, Reference to ID from table B) Table B ID (int, auto increase) Name City (Varchar) than i make Web Service from table A & B and success. When i make a client, i parse the Web Service XML from table A,it's problem to City_ForeignKey, when i want t...

Is it possible to create a TH with TableRow.insertCell()?

I'm adding new rows to a table dinamically, with this code: tbody = document.getElementById('tbody'); tr = tbody.insertRow(-1); tr.id = 'last'; th = tr.insertCell(0); td = tr.insertCell(1); But what I actually got are two TD cells. I want a TH, as you can see. It says the tagName property isn't changeable. How can I do this? Will I ...

jquery find next element with class

I'm having a brain fart here...I'm trying to find the next element with a class of "error" and hitting a wall. In looking at the demo on jQuery's site, this should work, but doesn't. $("button[disabled]").next().text("this button is disabled"); <div><button disabled="disabled">First</button> - <span>no overwrite</span><span class="...

PHP - dom appendChild() - adding strings around selected html tags using PHP DOM

Hiya, I'm trying to run through some html and insert some custom tags around every instance of an "A" tag. I've got so far, but the last step of actually appending my pseudotags to the link tags is eluding me, can anyone offer some guidance? It all works great up until the last line of code - which is where I'm stuck. How do I place t...

is newline (\n) not working for innerHTML in IE?

Hello I am facing the following problem: I have a HTML document where I want to print basic status/debug/etc messages. So, the HTML document contains an empty pre-element whose id is out: <body onload='init () && main();'> <pre id='out'> </pre> </body> </html> The init() function assigns the pre element to a variable: var out_d...

Firefox doesn't execute one dynamically loaded <script> element until another is loaded

I'm implementing Comet using the script tag long polling technique, based on this page. Following on from my previous question, I've got it all working, except for one annoyance, which only happens in Firefox. On the initial page load my Comet client JavaScript sends two requests to the Comet server (in the form of dynamically generated...

How might I get an element's border color value using jQuery?

Using $("#id").css("background-color") to retrieve an element's background color (or most other CSS attributes) works just fine, but $("#id").css("border-color") returns an empty string. How can I get the border color value used on the element? ...

Mootools script not working in Camino/Firefox

Hi there. I currently have script that slides down a once the page has loaded. So far, it works in Safari, Opera and IE8, however it doesn't work in Camino nor Firefox, so I am guessing it's a Mozilla based problem with my code? Here is my full file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtm...

Detecting valid DOM element

When I delete a DOM element using .removeChild(), the reference to the element still returns it as a valid element: var someNode = document.getElementById("someid"); if(someNode) alert('valid element'); else alert('invalid'); var p = document.getElementById('parent_id'); p.removeChild(someNode); if(someNode) alert('valid...

javscript document.getElementById in other frames

so, I have 2 frames and want to access to element from one frame into another : frame 1: <div id='someId'>...</div> frame 2: var div=document.getElementById('someId'); div.innerHTML='something'; this is somehow not functioning in Firefox so I want to be sure, can I access to element in another frame by its ID ? ...