Search Results

Search found 2174 results on 87 pages for 'dom'.

Page 2/87 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • What do the FireBug DOM colors mean?

    - by André Pena
    I'm confused with these colors. I noticed there are 4 colors showing in the left hand column of FireBug DOM tree: Bold black Black Bold green Green In the right hand column: Blue Red Bold green Green Multiple color elements representing object structures. What do this colors represent? And why, e.g, I can access window.document.URL and I can't access window.document.body in Console even though they are both in the "not-bold black" category in the DOM tree? Thanks a lot

    Read the article

  • Does visibility affect DOM manipulation performance?

    - by Chetan Sastry
    IE7/Windows XP I have a third party component in my page that does a lot of DOM manipulation to adjust itself each time the browser window is resized. Unfortunately I have little control of what it does internally and I have optimized everything else (such as callbacks and event handlers) as much as I can. I can't take the component off the flow by setting display:none because it fails measuring itself if I do so. In general, does setting visibility of the container to invisible during the resize help improve DOM rendering performance?

    Read the article

  • jQuery Adding DOM Elements

    - by Aren B
    This may be a simple answer, but I'm trying to add a dom-created element (i.e. document.createElement(...)) to a jQuery Selector. jQuery has a great assortment of functions for adding html .html(htmlString) .append(htmlString) .prepend(htmlString) But what i want to do is add a dom OBJECT var myFancyDiv = document.createElement("div"); myFancyDiv.setAttribute("id", "FancyDiv"); // This is the theoretical function im looking for. $("#SomeOtherDiv").htmlDom(myFancyDiv);

    Read the article

  • referencing DOM elements in jQuery

    - by Lyon
    Hi, I would select multiple DOM elements using a typical code such as this: $('#ele1, #ele2, #ele3').click(function () {}); If I have variables of each DOM element, e.g. var domEle1 = $('#ele1'); var domEle2 = $('#ele2'); var domEle3 = $('#ele3'); How can I select them all at once? Instead of individually... domEle1.click(function () {}); Thanks!

    Read the article

  • Javascript: getting element in dom tree when mouseover

    - by oimoim
    Hi, When using : document.onmouseover = function(e) {} Is there a property which gives me the element in the dom tree ? For example, I can set a style to e.srcElement But, how can I later access this element to (for example) reset its style ? And how can I know at which place in the dom tree it is ? I want to be able to situate it in the whole page dump. Many thanks.

    Read the article

  • javascript conflict on accesing DOM

    - by justjoe
    i read this statement from a book i read The Document Object Model or DOM is really not a part of JavaScript but a separate entity existing outside it. Although you can use JavaScript to manipulate DOM objects, other scripting languages may equally well access them too. what is the best way to avoid conflict between javascript and other client-siede scripting language when we have to deal with XMLHTTPRequest object

    Read the article

  • Objective-C DOM XML parser for iPhone

    - by phunehehe
    Hello guys I'm looking for a way on the iPhone to parse an XML document using DOM. I have been using SAX with NSXMLParser but now I really want a DOM tree (or anything that can quickly translate the XML document into an NSDictionary) Thanks for any help

    Read the article

  • Installing PHP DOM functions on Apache

    - by user352556
    I have just moved my code over to a new server (running on Apache 2.2.3), and PHP's DOM functions are now returning "Fatal error: Class 'DOMDocument' not found". I did some research and it appears that the installation I am now on does not have PHP's DOM functions enabled. I need to enable these functions, so what is the quickest way to go about this? Is it doable from a configuration file or will it require installation of extensions? Thanks!

    Read the article

  • Undo implementation - DOM manipulations

    - by sonofdelphi
    Is there a library that can be used for implementing undo/redo functionality for DOM element manipulations in JavaScript? I'm writing an app that moves around DOM elements, enables editing and deletion of those elements. There are event-handlers and other objects associated with each element operated upon. Not sure whether I need to roll my own implementation of the Command pattern for this. Surely, there must be something available? If not, suggestions and pointers would be a great help.

    Read the article

  • How do you query namespaces with PHP/XPath/DOM

    - by Alsbury
    I am trying to query an XML document that uses namespaces. I have had success with xpath without namespaces, but no results with namespaces. This is a basic example of what I was trying. I have condensed it slightly, so there may be small issues in my sample that may detract from my actual problem. Sample XML: <?xml version="1.0"?> <sf:page> <sf:section> <sf:layout> <sf:p>My Content</sf:p> </sf:layout> </sf:section> </sf:page> Sample PHP Code: <?php $path = "index.xml"; $content = file_get_contents($path); $dom = new DOMDocument($content); $xpath = new DOMXPath($dom); $xpath->registerNamespace('sf', "http://developer.apple.com/namespaces/sf"); $p = $xpath->query("//sf:p", $dom); My result is that "p" is a "DOMNodeList Object ( )" and it's length is 0. Any help would be appreciated.

    Read the article

  • Javascript: "Dangling" Reference to DOM element?

    - by Channel72
    It seems that in Javascript, if you have a reference to some DOM element, and then modify the DOM by adding additional elements to document.body, your DOM reference becomes invalidated. Consider the following code: <html> <head> <script type = "text/javascript"> function work() { var foo = document.getElementById("foo"); alert(foo == document.getElementById("foo")); document.body.innerHTML += "<div>blah blah</div>"; alert(foo == document.getElementById("foo")); } </script> </head> <body> <div id = "foo" onclick='work()'>Foo</div> </body> </html> When you click on the DIV, this alerts "true", and then "false." So in other words, after modifying document.body, the reference to the DIV element is no longer valid. This behavior is the same on Firefox and MSIE. Some questions: Why does this occur? Is this behavior specified by the ECMAScript standard, or is this a browser-specific issue? Note: there's another question posted on stackoverflow that seems to be referring to the same issue, but neither the question nor the answers are very clear.

    Read the article

  • Dom Traversal to Automate Keyboard Focus - Spatial Navigation

    - by Steve
    I'm going to start with a little background that will hopefully help my question make more sense. I am developing an application for a television. The concept is simple and basically works by overlaying a browser over the video plane of the TV. Now being a TV, there is no mouse or additional pointing device. All interaction is done through a remote control. Therefore, the user needs to be able to visually tell which element they are currently focused upon. To indicate that an element is focused, I currently append a colored transparent image over the element to indicate focus. Now, when a user hits the arrow keys, I need to respond by focusing on the correct elements according to the key pressed. So, if the down arrow is pressed I need to focus on the next focusable element in the DOM tree (which may be a child or sibling), and if they hit the up arrow, I need to respond to the previous element. This would essentially simulate spatial navigation within a browser. I am currently setting an attribute (focusable=true) on any DOM elements that should be able to receive focus. What I would like to do is determine the previous or next focusable element (i.e. attribute focusable=true) and apply focus to the element. I was hoping to traverse the DOM tree to determine the next and previously focusable elements, but I am not sure how to perform this in JQuery, or in general. I was leaning towards trying to use the JQuery tree travesal methods like next(), prev(), etc. What approach would you take to solve this type of issue? Thanks

    Read the article

  • Java Copy/Paste org.w3c.dom.Node between two running copies of the same program

    - by Jay
    I have a program that shows a tree representation of an XML file. Using a number of sources online I have Copy/Paste within a single instance of the program working. I am using the system Clipboard. What I need though is to be able to copy a node from one instance of the program and paste to a different instance of the same program. I have tried a number of different options, all resulting in the same behavior. When pasting from within the same application the clipboardContent contains a "transferable" object with the correct data along with an isLocal set to "true". When I perform the copy and then attempt the paste from another instance of the same program running the clipboardContent contains a "flavorsToData" HashMap and "flavors" values, the check for isDataFlavorSupported fails (never hits my custom class that represents the new flavor). I have tried using different values for the requestor object in the getContents() call. Likewise I have tried a few different ClipboardOwners for the setContent() call. Neither seem to change the behavior in any way. I am sorely tempted to convert the node that is being copied back into a textual XML format, and then on the paste convert back to the DOM model, but would rather not if possible. This class is used to define the DataFlavor and transferable object: import java.awt.datatransfer.*; import org.w3c.dom.Node; public class NodeCopyPaste implements Transferable { static public DataFlavor NodeFlavor; private DataFlavor [] supportedFlavors = {NodeFlavor}; public Node aNode; public NodeCopyPaste (Node paraNode) { aNode = paraNode; try { NodeFlavor = new DataFlavor (Class.forName ("org.w3c.dom.Node"), "Node"); } catch (ClassNotFoundException e) { e.printStackTrace (); } } public synchronized DataFlavor [] getTransferDataFlavors () { return (supportedFlavors); } public boolean isDataFlavorSupported (DataFlavor nodeFlavor) { return (nodeFlavor.equals (NodeFlavor)); } public synchronized Object getTransferData (DataFlavor nFlavor) throws UnsupportedFlavorException { if (nFlavor.equals (NodeFlavor)) return (this); else throw new UnsupportedFlavorException (nFlavor); } public void lostOwnership (Clipboard parClipboard, Transferable parTransferable) { } } I define a Clipboard object from the main application screen and then tie in copy and paste handlers for the mouse clicks: During initialization I assign the system clipboard: clippy = Toolkit.getDefaultToolkit().getSystemClipboard(); Copy Handler Node copyNode = ((CLIInfo) node.getUserObject()).DOMNode.cloneNode(true); NodeCopyPaste contents = new NodeCopyPaste(copyNode); clippy.setContents (contents, null); Paste Handler Transferable clipboardContent = clippy.getContents (null); Node clonedNode = null; if ((clipboardContent != null) && (clipboardContent.isDataFlavorSupported (NodeCopyPaste.NodeFlavor))) { try { NodeCopyPaste tempNCP = (NodeCopyPaste) clipboardContent.getTransferData (NodeCopyPaste.NodeFlavor); clonedNode = tempNCP.aNode.cloneNode(true); } catch (Exception e) { e.printStackTrace (); } Thanks!

    Read the article

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

    - by Scozzard
    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); $(".thickbox", jqDom).remove(); $(".thickboxcontent", jqDom).remove(); editor.set_html(this.innerHTML); NOTE: The HTML is derived from content in a RADEditor text editor so there are no parent HTML tags, so can look as follows: <p>This is a header</p> <p>this is some content followed by a table </p> <a href="#TB_inline?height=350&amp;width=400&amp;inlineId=myOnPageContent0" class="thickbox">Test Thickbox</a> <div id="myOnPageContent0" class="thickboxcontent"> <table class="modal"> <thead> </thead> <tbody> <tr> <td>item</td> <td>result</td> </tr> <tr> <td>item 1</td> <td>1</td> </tr> <tr> <td>item 2</td> <td>2</td> </tr> <tr> <td>item 3</td> <td>3</td> </tr> </tbody> </table> </div> Here is what the jqDom.html() returns from the HTML above: "This is a header" I was wondering if there was an easy way to do this - have some html and remove all elements (in this case divs) that have a certain class (but leaving their contents). JQuery doesnt have to used, but I would like to. Manipulating the DOM object is fine - it is getting the full DOM object in its entirety as a string that I am having the problem with. Any help would be much appreicated. Thanks.

    Read the article

  • jQuery DOM element creation vs innerHTML

    - by Mohammad
    While having one of my questions answered, cletus mentioned that when creating elements in jQuery it's better to use direct DOM element creation, instead of innerHTML. I tried googling it but I wasn't able to find a good article with comparisons. I've provided this code bellow as an example and I was wondering if someone could help me rewrite it in direct DOM element creation form in hope that i would also learn the difference afterwards. var img = $(this); img.append('<p class="cap"><a href="'+img.parent().attr('href')+'">'+ img.attr('title')+'</p></a>'); Thanks so much.

    Read the article

  • Memory Issues When DOM Parsing A Large XML File on Android Devices

    - by tonyc
    Hey awesome SO users, I have an Android application that parses an XML file for users and displays results in a much more mobile friendly format. The app works great for most users, but some users have lots and lots of data and the app crashes on them because it runs out of memory. Is there any way I have a DOM style XML parser quit parsing data after a certain amount of parsing? I only need the first 30 or so elements so it would make the application much more efficient. I'd like to use a SAX or pull parser instead, but the XML I'm parsing is not valid and I have no control over it. Unless anyone has some good SAX solutions that let me parse messy, invalid XML, I think DOM is the only way to go. Thanks for reading!

    Read the article

  • Storing DOM reference elements in a Javascript array

    - by webzide
    Dear experts, I was trying to dynamically generate DOM elements using JS. I read from Douglas Crockford's book that DOM is very very poorly structured. Anyways, I would like to create a number of DIVISION elements and store the reference into an array so it could be accessed later. Here's the code for(i=0;i<3;i++){ var div=document.body.appendChild(document.createElement("div")); var arr=new Array(); arr.push(div); } Somehow this would not work..... There is only 1 div element created. When I use the arr.length to test the code there is only 1 element in the array. Is there another way to accomplish this? Thanks in advance

    Read the article

  • DOM and Javascript

    - by Bob Smith
    I let a user reconfigure the location of a set of rows in a table by giving them ability to move them up and down. The changes are done by swapping nodes in the DOM. After the user has moved rows around, when I do a view source, I see the HTML in the original state (before the user made any changes). Can someone explain why that is? My understanding was when we do any DOM operations, the underlying HTML will be changed as well. EDIT: Does that mean on the server side, when attempt to get the state after user's changes, I will be able to get what I need? I am using C#/ASP.NET. Could it be because this is a HTML table (not ASP.NET Server control), that it's not maintaining the state of the changes?

    Read the article

  • Returning a DOM element with Webdriver in Javascript

    - by ehmicky
    How do I return a DOM Element with Webdriver in Javascript? I am using the wd.js Javascript bindings: require("wd") .remote("promiseChain") .init() .get("http://www.google.com") .elementById("mngb") .then(function(element) { console.log(element); }); I am getting this weird object that is not a standard DOM Element (for example I cannot get the HTML code out of it): { value: '0', browser: { domain: null, _events: {}, _maxListeners: 10, configUrl: { protocol: 'http:', slashes: true, auth: null, host: '127.0.0.1:4444', port: '4444', hostname: '127.0.0.1', hash: null, search: '', query: {}, pathname: '/wd/hub', path: '/wd/hub', href: 'http://127.0.0.1:4444/wd/hub' }, sauceRestRoot: 'https://saucelabs.com/rest/v1', noAuthConfigUrl: { protocol: 'http:', slashes: true, host: '127.0.0.1:4444', port: '4444', hostname: '127.0.0.1', hash: null, search: null, query: null, pathname: '/wd/hub', path: '/wd/hub', href: 'http://127.0.0.1:4444/wd/hub' }, defaultCapabilities: { browserName: 'firefox', version: '', javascriptEnabled: true, platform: 'ANY' }, _httpConfig: { timeout: undefined, retries: 3, retryDelay: 15, baseUrl: undefined }, sampleElement: { value: 1, browser: [Circular] }, sessionID: '238c9837-3d82-4d90-9594-cefb4ba8e6b9' } }

    Read the article

  • Is the javaScript not part of the DOM?

    - by DKinzer
    Why is it that scripts can still function even after the code used to create them is removed from the DOM? I ran into a situation where I wanted to prevent a broken script from running (@see my post). In my attempt to come up with a solution I wrote an extension with the following line (just to see what would happen). //doc is passed here because this script is running as a firefox extension outside //of the document context. $('script', doc).remove(); I assumed that this would remove all the scripts from the DOM, which it did, and that therefore no scripts would run on the page, which is not the case. I would love to know more about what's behind this behavior.

    Read the article

  • Word on HTML document point, using UIWebView, DOM and Javascript

    - by leolobato
    Hey guys, How can I figure out which word is at the point where the user tapped on a UIWebView? I am able to detect the CGPoint for the tap (subclassing UIWindow like this), and I can actually get the DOM element on that point using javascript. But I know very little of javascript and DOM to figure out how can I actually get which word the user tapped on. Is that possible? Here's what I have right now: int scrollPosition = [[webView stringByEvaluatingJavaScriptFromString:@"window.pageYOffset"] intValue]; NSString *js = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f).tagName", point.x, point.y+scrollPosition]; NSString *value = [webView stringByEvaluatingJavaScriptFromString:js]; NSLog(@"element: %@", value);

    Read the article

  • Run a function when a DOM element is created

    - by Ed Woodcock
    Hi folks, I want to bind an event to a certain class and ID for when matching objects are created in the DOM. I am doing this as I have some jQuery code in an ASP UpdatePanel, which causes the DOM to be re-loaded on its partial postback. I have reset the events with live(), however I need to call a 2 line initialisation function as soon as the elements are created. Is there any way to attach this to live(), or some other jQuery function, or will I have to write code to do this myself? Thanks, Ed

    Read the article

  • Speeding up jQuery empty() or replaceWith() Functions When Dealing with Large DOM Elements

    - by Levi Hackwith
    Let me start off by apologizing for not giving a code snippet. The project I'm working on is proprietary and I'm afraid I can't show exactly what I'm working on. However, I'll do my best to be descriptive. Here's a breakdown of what goes on in my application: User clicks a button Server retrieves a list of images in the form of a data-table Each row in the table contains 8 data-cells that in turn each contain one hyperlink Each request by the user can contain up to 50 rows (I can change this number if need be) That means the table contains upwards of 800 individual DOM elements My analysis shows that jQuery("#dataTable").empty() and jQuery("#dataTable).replaceWith(tableCloneObject) take up 97% of my overall processing time and take on average 4 - 6 seconds to complete. I'm looking for a way to speed up either of the above mentioned jQuery functions when dealing with massive DOM elements that need to be removed / replaced. I hope my explanation helps.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >