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.U...
Examples of stuff I'd like to do:
- process javascript and produce new DOM
- be able to provide information about DOM objects as rendered (e.g. position, size)
Edit: My main concern is if a page contains a large, central flash object (typically a movie or game).
...
I need a Javascript regular expression that scans a block of plain text and returns the text with the URLs as links.
This is what i have:
findLinks: function(s) {
var hlink = /\s(ht|f)tp:\/\/([^ \,\;\:\!\)\(\"\'\\f\n\r\t\v])+/g;
return (s.replace(hlink, function($0, $1, $2) {
s = $0.substring(1, $0.le...
This is similar to the problem here: .../questions/1386228/add-form-element-dynamically-using-javascript-not-submitting but I don't know what his answer was besides rewriting from scratch.
Here's my problem:
Form elements added dynamically to the page do not appear in the $_POST array. I'm doing this same method several other instances...
Hi,
In my application I am loading xml from url in order to parse it.
But sometimes this url may not be valid. In this case I need to handle errors.
I have the following code:
$xdoc = new DOMDocument();
try{
$xdoc->load($url); // This line causes Warning: DOMDocument::load(...)
// [domdocument.load]: failed to op...
There's something I don't fully understand about node cloning with the PHP's DOM api. Here's a sample file that quickly duplicates the issue I'm coming across.
$doc = new DOMDocument( '1.0', 'UTF-8' );
$root = $doc->createElement( 'root' ); // This doesn't work either $root = new DOMElement( 'root' );
$doc->appendChild( $root );
$doc...
Hi all, I'm writing a userscript for a website that uses Prototype. Rather than use the GM libs (mainly so I can easily repurpose it for Chrome), I decided to use the already-loaded Prototype functions.
I'm iterating through the rows of a table, each signifying a unique user, by checking for an online status element on their profile pa...
Hi,
I don't know if what I'm trying to accomplish is possible at all. I would like to override the default behaviour for all the anchor objects ('a' tag) for a given HTML page. I know I can loop through all the 'a' elements and dynamically add an 'onclick' call to each one of them from the body element 'onload' method, but I'm looking f...
What's the correct way to do an ajax request, I've seen people using a returning render_to_string so that they can do all their formatting within python using the template language. eg~
return render_to_string('calendar.html', {
'self' : self,
'month' : self.today.month,})
with this as the javascript:
$('#django_calendar_response').h...
Hi,
Imagine I have the following HTML:
<div><span><b>This is in bold</b></span></div>
I want to get the HTML for the div, including the div itself. Element.innerHTML only returns:
<span>...</span>
Any ideas? Thanks
...
I'm creating HTML dynamically in a WebBrowser control. Most elements seems to appear correctly, with the exception of a table.
My code is:
var doc = webBrowser1.Document;
var body = webBrowser1.Document.Body;
body.AppendChild(webBrowser1.Document.CreateElement("hr"));
var div = doc.CreateElement("DIV");
var table = doc.CreateElement("...
I have an HTML page containing alot of meta tags and I want to parse them to find certain ones. Here is the code I am using, but it's not picking up any of the tags.
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->loadHtml($contents);
$metaChildren = $dom->getElementsByTagName('meta');
var_dump...
Is it possible to access the DOM of a firefox page from a process outside of Firefox (in Windows.) It is possible to do with in IE via the accessibility interface and is a commonly used technique to access the IE browser without installing a BHO. But I was wondering if there is a similar technique available for Firefox, or must I install...
Lets say I have a page with this code on it on www.foo.com:
<script src="http://www.bar.com/script.js" />
Can I write code from within script.js that can check that it was served from bar.com? Obviously document.location.href would give me foo.com.
Thanks!
...
This is a simplified version of my problem.
I have two buttons, and one image. The image code is something like this
<img class="onoff" src="image.jpg">
When I press button one I want the image to be wrapped in an A tag, like
<a href="link.html">
<img class="onoff" src="image.jpg">
</a>
And when I press the other button, the A ta...
I am at loss to understand how popup windows´ DOM-trees and their manipulation from opener window work. What is the proper way to implement what I am trying to do (described below)?
I have one normal browser window where JavaScript function gathers selected elements and creates POST data string from them.
I then open a popup window with...
How can I extract the value attribute of an input tag? Using SIMPLE HTML DOM
let me give you an example:
<form action="#" method="post" name="test_form" id="test_form">
Name<input type="text" name="name" value="NaMe"/><br />
Address<input type="text" name="address" value="AdDrEsS"/><br />
<input type="hidden" value="sayantest" />
</fo...
I have an application where I've been using html5lib to liberally parse html. I use the minidom interface, because I need a real DOM API and ElementTree is not appropriate for what I'm doing.
Here's how I do this:
parser = html5lib.XHTMLParser(tree=html5lib.treebuilders.getTreeBuilder('dom'))
parser.parse(html)
However, parsing huge ...
Hello,
I'm writing a web app. Based on certain choices the user selects, it dynamically creates a number of checkbox input elements. For the sake of usability, they should be created in a checked state, and the user would uncheck the ones they don't want.
I have the code working fine in Firefox. Unfortunately, I have to target IE 7....
I have bunch of objects that return a DOM-tree that I then use to append to an element. For example,
var elem = document.createElement('div');
elem.appendChild(callSomePrototypesMethod());
elem.appendChild(callSomePrototypesMethod());
elem.appendChild(callSomePrototypesMethod());
and I will eventually end up in something like:
<div>
...