dom

Invoke JavaScript on 3rd party domain

I want to write some javascript and have it call into the DOM for a page I am loading from a 3rd party domain. Can this be done? This looks like what I've already tried using IFRAME but it would seem that doesn't work. Is these some other way like having FF run some javascript directly rather than as part of a page? I know this has all ...

Dynamically retrieve Html element (X,Y) position with JavaScript

Hi all I want to know how to get X and Y postion of HTML elements such as img, div in JavaScript. thanks ...

Logic behind hiding elements

I am having a dilemma in the logic of this particular issue. Forgive me if this is quite newbie question but I'd rather have a solid bg on it. There are a lot of examples of this all around the web where you click on an element to display another element. such case may be a menu that when you hover your mouse on it (or click on it) its ...

Does casing matter when spelling DOM event names?

When specifying a DOM event name in Javascript, does casing matter? For example, which of the following will work reliably: onMouseOver onmouseover Both are ok. Casing does not matter. It's more complicated than that.... ...

How to find event listeners on a DOM node?

I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event? Events are attached using 1) prototype's Event.observe 2) DOM's addEventListener 3) as element attribute element.onclick ...

ajax in each time or load everything at once

you have several links on a page. when clicked, a div gets updated via ajax. the updated div includes data from the database. according to this scenario, every time a link is clicked, the date is grabbed from the database and injected into the div. would you now; 1) support this scenario or... 2) would load each link's content in sev...

Hiding Elements

referring to my previous question I came accross to another problem. The div I am showing includes links in it. When I click on them, the div disappears as expected but not as desired.. (we want it to disappear whenever we click on anywhere on page... but the links inside them) the code currently being used: $.listen('click', '.tab...

Subscript text in HTML

Dear All I am Using the following code to write the table, Now i wish to add subscript text,after the table text ,How can it achieved ? My code has oCell = document.createElement("TD"); oCell.innerHTML = data; oRow.appendChild(oCell); how to add a subscript text followed by data ? ...

Is there an idiomatic way to listen for changes to the DOM using the Prototype library?

I'm trying to add a listener to DOM change events. I was hoping something as simple as 'dom:loaded' was baked into Prototype. I'm not sure of the 'Prototype-way' to handle this. EDIT: I cannot control every case in which the DOM may be altered, so I can't get away with firing a custom event on every DOM change. ...

JavaScript DOM code not working

My HTML has cell = document.createElement("td"); cell.appendChild(document.createTextNode(contents)); cell.setAttribute('width', '100'); // The following syntax not working cell.appendChild(document.createElement('br')).appendChild(document.createTextNode("Another text")); And after the contents of the cell, I have a line break fol...

events for nested elements

I am using the listen plugin for jQuery for binding events to dynamically created elements. In my scenario, I have a div hosting a span element. I want function "spanClicked" to fire on span click and function "divClicked" to fire on div click when I click on the div to fire function "divClicked", since the span is inside of it, funct...

How to use jQuery to get all the submitable elements in a form?

Like < textarea >, < input > etc ...

How do I remove a specific node using its attribute value in PHP XML Dom?

My question is best phrase as: http://stackoverflow.com/questions/262351/remove-a-child-with-a-specific-attribute-in-simplexml-for-php except I'm not using simpleXML. I'm new to XML for PHP so I may not be doing the best way I have a xml created using the $dom->save($xml) for each individual user. (not placing all in one xml due to un...

Reading HTML file to DOM tree using Java

Is there a nice parser/library which is able to read an HTML document into a DOM tree usinf Java? I'd like to use the standard DOM/Xpath API that Java provides. But all libraries I can find only seem have custom APIs to solve this task. Furthermore the conversion HTML to XML-DOM seems unsupported by the most of the available parsers. A...

Reading and editing HTML in .Net

Is there a .Net class for reading and manipulating html other than System.Windows.Forms.HtmlDocument. If not, are there any open source libraries for this. ...

How to pass DOM element to a API function?

While trying to integrate Yahoo Media Player into my own website, I want to allow users to click on a link to add the clicked track to the playlist. YMP API has got a function for doing that (http://mediaplayer.yahoo.com/api/#method_addTracks). It takes a DOM element. Now how should I pass the dom element. My code looks like this right n...

jquery slideDown rather than slideAndPush

I have a div where I click on a link to slideDown. As expected it does what it promises however, I prefer it to slide open without pushing the other elements down as well. so like a layer on top of other layers. is this possible ? ...

IS it safe to use window.location to query the GET params of a page?

I'm doing a peer review and I've found people using window.location.search to check what paremetes have been sent to a given (search) page. Is it safe to do so? I was thinking that we could probably print the parameters in the HTML output inside a script block and verify the printed variables instead of querying window.location. ...

How do I "refresh" element in DOM?

Hi, I've got an empty DIV element in which I append images by using function createElement("img") and append them with appendChild. So now I've got DIV element full of images. I would like to use one button to clean this DIV and add new images in it simultaneously. Thanks for your help ...

How to eliminate post-render "flicker"?

I've tried my best to be a purist with my usage of Javascript/Ajax techniques, ensuring that all Ajax-y behavior is an enhancement of base functionality, while the site is also fully functional when Javascript is disabled. However, this causes some problems. In some cases, a DOM node should only be visible when Javascript is enabled in...