dom

How to detect "has user selected entire document or not ?" in html javascript

I'm developing a off-line web-page for iphone safari. For highlighting the user's selection in web-page. I've implemented following code. function highlight() { if (window.getSelection) { sel = window.getSelection(); if (sel.getRangeAt) { range = sel.getRangeAt(0); } document.designMode ...

How does GWT "know" which DOM element you've just selected?

It has been a while since I've touched GWT, but I was recently looking at GWT applications to see how they accomplished certain tasks. I noticed that if you go into AdWords (a GWT application), you can manipulate table information in-line. For example, if I go into my campaign and click the pencil icon next to the ad group, a little popu...

XML Dom prcocessing probelm

i want to modify xml file using dom ,but when i make node.getNodeValue(); it returns null !i don't know why ?my xml file contains the following tags : [person] which contains child [name] whcih contains childs [firstname ,middleInitial ,lastName] childs i want to update First name , middleInitial and last name using dom this is my java...

Firefox thinks form is not defined, but IE and Chrome do.

I'm trying to get the value of a drop-down menu selection. Here's my XHTML: <form action="(EmptyReference!)" method="get" name="myForm" id="myForm" onsubmit="myValidation(this)"> <fieldset> <select name="mySelect" id="mySelect"> <option value="o1" selected="selected">Option 1</option> <option valu...

Clent-side data storing,DOM storage or HTML5 Local Storage ?

Im really confused when thinking about my requirement to store data locally for offline viewing.Now i have two options,DOM storage and HTML5 Local storage. As im a complete newbiew in this particular topic,i need some help of SO Experts and Gurus. Whats the Advantage and Dis-advantage of these two.?can any one compare these one.,so that ...

JS: innerHTML and DOM aren't cooperating

I've noticed a funny behavior and was wondering if anybody could shed some light on the reason. It breaks down like this: I've added a div and a button using Javascript's `appendChild'. I add an onclick handler to the button, works fine I add-assign the innerHTML of the div to add some more content Button onclick stops working altoge...

How to insert HTML string in between two DOM nodes?

Consider following DOM fragment: <div id="div-1">foo</div> <div id="div-2">bar</div> Is it possible to insert HTML string (EDIT: that contains tags to render) between divs without wrapping it in another div (EDIT: or some other tag) created via document.createElement and setting its innerHTML property? ...

javascript dom inspection code doent work on IE

Hello, this question is for the JS experts out there. I use this next piece of code to get all the JavaScript function names which exist under the dom root. for(var x in window){ val = ""+window[x]; if(startsWith(val,"function")){ //only functions alert(val) } } While this code works perfectl...

Extract HTML of a Scraped Page Using PHP's DOM

Is it possible to create HTML output from the contents of an HTML snippet that has been extracted via PHP's DOM tools (e.g. $div = $dom->getElementsByTagName('table')->item(0);) such that the HTML created contains just the elements with specified tag name, and their descendants? Otherwise, are there perhaps any other ways to easily ext...

perl xml dom error

try.pl is a script that is trying to generate sample.xml which should validate against sample.xsd. I am getting some errors. Guide me if possible. portion of sample.xsd <xs:element name="element1" maxOccurs="unbounded"> <xs:complexType> <xs:SimpleContent> <---- line number of error <xs:extension base="xs:token"> ...

javascript/jQuery: how do you dynamically turn attribute values into object keys?

Here is my problem, I have a whole bunch of elements that look like this... <input type="email" id="email" data-item="email" data-key="contact_details"/> <input type="tel" id="mobileNo" data-item="mobileNo" data-key="contact_details"/> <input type="text" id="sleeve_length" data-item="sleeve_length" data-key="measurements"/> <input type...

jQuery update DOM to access injected html tags

Ok I'm submitting a form via ajax. The result string is a bunch of html links and images which I append to the body of the DOM. Is it possible to search with jQuery within this new code? before ajax request: <div id="results"></div> after ajax request: <div id=results"> <img src="somevalidpicture.jpg" class="image"/> <img src="...

DOM parser that allows HTML5-style </ in <script> tag

Update: html5lib (bottom of question) seems to get close, I just need to improve my understanding of how it's used. I am attempting to find an HTML5-compatible DOM parser for PHP 5.3. In particular, I need to access the following HTML-like CDATA within a script tag: <script type="text/x-jquery-tmpl" id="foo"> <table><tr><td>${name}...

what happens when you use javascript to insert a javascript widget?

can anyone explain what happens when you use javascript to insert a javascript based widget? here's my js code: var para = document.getElementsByTagName("p"); var cg = document.createElement("div"); cg.setAttribute("class", "twt"); cg.innerHTML='<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data...

java/ soapfault problem in web services

Hi, I have the following problem: I am using SAAJ for web services. I have a SOAPMessage with the following soap fault: <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt; <S:Body> <S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"&gt; <faultcode>S:Server</faultcode> <faultstring>java....

ExtJS - Fill and Auto Height

Hi! I'm using ExtJS (html/css) and I've got a question regarding Layout. Example: |--------| | | | | | | | | | | |--------| | | | | |--------| The combined height (they don't have any padding, margin etc.) is 100% of it's parent container. Preferably, it's two panels somehow stacked on...

Why is javascript sending an element to my event handler, when that element has no event?

This html: <span id="mySpan"><img src="images/picture.png" alt="Some nice alt text" /> Link text</span> This javascript takes the span containing the image and text, then makes it clickable: spanVar = document.getElementById("mySpan"); spanVar.addEventListener("click", myEvent, false); function myEvent(e){ var obj = e.target; } ...

how to fetch custom google search results by simple html dom parser ?

Hi I have custom google search included on a html page. like http://www.*.com/search.htm?cx=partner-pub--00000000000-c77&amp;cof=FORID%3A10&amp;ie=ISO-8ds3-1&amp;q=software&amp;sa=Search&amp;siteurl=www.*.com%2#1342 When I am using same url in browser i get results. I want to call it by simple dom html parser then it is returning blank...

dom wrapping a substring in textnode with a new span node

Suppose, I have this paragraph: <p>this is a paragraph containing link to an image at http://lol/atme.png :)</p> I want to replace http://lol/atme.png with an image element. How do I do that? Its like removing the text, but adding a image element in place of that text. Help will be greatly appreciated. ...

Extracting the javascript from an anchor's href using jQuery or JavaScript

Does anyone know an easy way to use jQuery (or other Javascript if necessary) to extract only the Javascript portion of an anchor tag's href attribute (like the one below), so it can be assigned to another event at runtime? <a id="FancyLink" href="javascript:DoSomething('Input1')">Do</a> I know how to get the anchor's whole attribute ...