dom

Running an action when mousing over (and leaving) an element (or its child elements)

Imagine I have the following elements: +------------------+ | | | +----------------+ | | | | | | | +----------------+ | | +------------------+ The inner element has positioning that mean it can visually sit outside of its parent, and I put an event listener on...

MooTools: domready vs load

With which will function(){} fire first? A) window.addEvent('domready', function(){}); B) window.addEvent('load', function(){}); ...

Prototype: wrapping raw HTML to create extended element

Hi all I am reading in a complex chunk of HTML and I'd love to be able to walk this sub-tree of HTML in the same way I can the DOM. Is there a way in Prototype to take a raw chunk of HTML (say from an AJAX call) and 'wrap it' in some way so that it becomes a Prototype element and thus allow me to search it using .up() .down() etc? ...

How to capture DOM modifications with JavaScript and send them to a PHP server

I've been asked to create a web UI that allows a user to modify a specific section of the HTML DOM and then POST the modifications back to the server for storage. The modification should be done via drag'n'drop, with my tool of choice being jQuery. The server will be PHP, but written by someone else since I'm not a PHP programmer. The ...

How to change a link into a span of text or some kind of non-anchored element with prototype

I have a link: <a id="theLink" href="h***://stackoverflow.com">Go to SO</a> How can I use prototype to either strip <a>'s or just leave the innerHTML so that the elements becomes: [h***://stackoverflow.com] (something that is no longer clickable)? Or maybe convert the <a> to a <span> ...

Why does firebug add <tbody> to <table>?

I viewed the html source code, there is no <tbody>, but when viewed via firebug in the HTML tab, <tbody> appears. Any idea why? ...

Which methods and class will be invoke when reload a webpage or open a new webpage in safari

As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit informal protocol(WebFrameLoadDelegate): webView:didStartProvisionalLoadForFrame: webView:didChangeLocationWithinPageForFrame: But I want to know whick class and methods will be invoked when reload a webpage or open a new webpage ...

How to get a flash url in a webpage using a webframe?

As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit informal protocol(WebFrameLoadDelegate): webView:didStartProvisionalLoadForFrame: webView:didChangeLocationWithinPageForFrame: and I know when reload the page I can do this: - (void)webView:(WebView *)senderdidStartProvisionalLoadFor...

alternative to html top.document inside iframe

Hello, We have a web application where we're using "top.document" since this application uses iframes and sometimes we must reach the top document. The problem started now since we need to integrate this application in a website and we put it inside an iFrame in this very site. Since the application uses "top.document" it is reaching t...

DOM/XPATH in PHP: What is nodeValue?

Can someone explain to me what is nodeValue in this and write out how nodeValue look like or write out what's in nodeValue? EDIT: Sorry! Yes, this is PHP. And.. foreach ($elements as $e) { echo $e->nodeValue; } What does the arrow thingy mean (->)? That's an array right? Well if you can explain to me this one part that would be gre...

Omitting the standalone attribute in xml declaration when using Java DOM + Transformer.

Hey guys, is there any way to tell the Transformer (when serializing an xml document using DOM), to omit the standalone attribute? Preferably without using a hack , i.e. ommitting the whole xml declaration and then prepending it manually. Thanks -Vic My current code: Transformer transformer = TransformerFactory.newInstance().newTran...

refactor to use oop mvc

how do I refactor this to use oop , with mvc pattern. (function () { var dataToImage = { 'a': 'a.gif', 'b': 'something.gif' }; var currentimage = dataToImage['a']; function setCurrentImage(e){ currentImage = e.src; } function getMousePosition(){ } function drawToolbar { for(i in dataToImage){ document.write('<img sr...

How to get the flash cache file in safari webpage?

Now I am making a safari plug-in for get flash url. and then show it in my webview . But if I downloaded these flash before showing them, it took long time and maybe some time delay. how to find the method to get the flash local cache showing in safari? Thank you very much! ...

Firefox logs invalid URL?

I'm writing an extension for firefox. Using dom.location to keep track of visited search results pages, i'm getting this url http://www.google.com/search?hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=642c18fb4411ca2e . If you click it, the google search results for "hi" should come up. You'll know that from the title bar ...

javascript get selected html elements

User is on a webpage , uses his mouse to select stuff, how can i use javascript to know what has been selected? ...

How do I do OuterHTML in firefox?

Part of my code I get the OuterHTML propery "<LI onclick="TabClicked(this, 'SearchName', 'TabGroup1');">Name " so I can do stuff involing parsing it. There is no OuterHTML property in javascript on firefox though and I can't find an alternative way to get this string. Ideas? ...

Using greasemonkey and/or gmail API to reduce width of mail pane.

Hi there. I'm on my way to creating a greasemonkey script for gmail. The first thing I want to play with is reducing the size of 'main' pane. This is where either the list of emails are or where the email message is being displayed. Using Firebug, I can find two separate instances of a "<div class="nH nn" style="width: 1013px;">" tag....

How to prevent page's scroll position reset after DOM manipulation?

I've got two JS functions, one that is adding options to a select box function addOption(selectId, text, value) { var selectbox = document.getElementById(selectId); var optNew = document.createElement('option'); optNew.text = text; optNew.value = value; try { selectbox.add(optNew, null); //page position reset...

Why is my jQuery plugin for removing text on focus and re-adding it on blur not working?

I would like the text in the value field of a text box to disappear when that text box gains focus, and then reappear in response to the eventual blur event - but only if the value is empty (that is, if the user hasn't entered anything after putting focus into the text box). So far, I have this: this.each(function() { obj = $(this...

Internet Explorer PNG DOM Loaded Images

I have a site setup using transparent PNG images that, of course, don't want in IE without the transparency fix applied. Well, the fix is applied but it still isn't working. div, img { behavior: url('/path/to/fix/iepngfix.htc'); } I know it's loading the HTC file correctly as an alert(1) fires upon page load. The images, however, aren'...