Hi
I've got this markup (simplified):
<div class='item'>
<a> one link </a>
<a class='trash'><img src='trash.png'/></a>
</div>
I'm highlighting the div when the mouse enters, and showing the (otherwise hidden) 'trash' link (it's like a tiny trash bin) so the user can delete the link.
I can't use 'hover' effect, because I need the...
Why is the first alert box empty, but the second one says 100px?
I'd expect the first box to say 300px..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html...
I'm new to PHP DOM object and have a problem I can't find a solution. I have a DOMDocument with following HTML:
<div id="header">
</div>
<div id="content">
<div id="sidebar">
</div>
<div id="info">
</div>
</div>
<div id="footer">
</div>
I need to get all nodes that are on first level (header, content, footer). hasChild...
Is it possible to check if the browser user has opened a new tab, is closing (not minimizing) the current tab/page, or changing the url? Don't worry, nothing suss it's just for a novelty website. Could someone let me know if this is/isn't feasible via javascript (preferably jquery), and if so, what method to look into. Thanks
EDIT: In t...
Hello all,
I'm trying to create an <ol> element with jQuery and set its class and id attributes. Is there any way to do this all at once? None of my ideas have worked so far, I'm still very new to jQuery...
...
I have a bookmarklet storing a lot of DOM data, but I would love to avoid to put them out of the body tag so the script in the page won't mess with it.
Semantic value is not an issue for once, but I would like to know :
will it trigger some browser behaviour ?
will it still be accessible in the DOM ?
can I display it using absolute po...
i'm opening a popup from window a of http://example.com. then close window a and open another window b with same domain, http://example.com. ıs it possible to access popup's DOM from window b and how?
popup is opened from window a by window.open('http://example.com/blah', 'somename', settings..), executing the same from window b with di...
There is a great method in jquery called wrap() that will wrap a selected element inside a new element, like so:
Start with:
<p>I wish I was wrapped!</p>
Add code:
$("p").wrap("<div></div>");
End with:
<div><p>I wish I was wrapped!</p></div>
But what I need is something that will unwrap, so that the above process is reversed....
I just found out that onchange event does not bubble in MSIE. I hopped to http://www.quirksmode.org/ to see if I could find other events which are not supported by IE. However I do not see any chart listing onchange event as an event that does not bubble in MSIE. Where can I find such a char?
...
I rewrote a bit of my code based on that it's not really feasible to check to see if a javascript variable changes. But, how would I do it with a dom element? For instance
<div id='foo'>123</div>
<script>
$('#foo').html('456');
// function gets fired since #foo changed.
</script>
I tried
$("#foo").change(function () {
alert('ch...
How do you go around adding an element to the DOM which still knows which instance of an object created it so that it can refer back to the class later on?
Basically the following code should allow you to add one or more photo albums to a page, where Javascript generates all the DOM elements needed.
I.e. in the following code example i...
I am looking for a solution that works cross browser i.e. IE, Firefox and Safari.
...
Hey all,
My Google maps code is all squared away and valid, but it doesn't load on the page. Here is the page in question, I have full availability to code, not sure why it's breaking:
http://whs.rjuhsd.us/calendar/map
The Gmaps JS is in the header, with the correct key. Sensor is set to true, and the element is defined in the documen...
I have some HTML code like this:
<div style="background:red;width:900px;height:200px" id="wrap">
<div id="inner" style="width:300px;float:left">
...
</div>
</div>
I need to:
1) Remove "styles" attribute and maybe some others
2) Leave only "id" attribute
4) Get resulting HTML as a string
5) All of this without affect...
I have a method in java that has 2 String parameters and it writes string to a file, now I have dom doc that holds value that I need to write to a file but its not string type, how can I convert it to a string here is my code :
import java.io.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import javax.xml.parsers.*;
import javax.xml.tr...
If i dont put autocomplete="off" on my <input type="text" />s the browser will sometimes fill them in with likely/remembered data.
When does this happen in the DOM-load-lifecycle?
It appears to be after:
$(function(){ alert('i happen before autocomplete'); });
Is there a dom-load event which occurs after form-autocompletion?
If s...
I have been trying to make something work with JQuery. I have the following function:
<script type="text/javascript">
$(function(){
// start a counter for new row IDs
// by setting it to the number
// of existing rows
var newRowNum = 2;
// bind a click event to the "Add" link
$('#addnew').click(function(){
...
I have the coordinates (X,Y) of a point in an HTML document. How do I determine what DOM node is at those coordinates?
Some ideas:
Is there a DOM hit test function that I missed, that takes a point (X,Y) and returns the DOM element there?
Is there an efficient way to walk the DOM element tree to find the containing element? This seems...
Say I had to links with up/down arrows for moving a table row up or down in order. What would be the most straightforward way to move that row up or down one position (using jQuery)?
There doesn't seem to be any direct way to do this using jQuery's built in methods, and after selecting the row with jQuery, I haven't found a way to then ...
I've searching forever trying to figure out why IE will not save the current caret position and then reload it. To be descriptive of the situation it works like this:
Client wants Tinymce custom built with an ajax image loader that is simplistic in the nature that any "idiot" can upload and set some settings to an image within the text...