dom

While doesn't work

function Sort(td) { var t=document.getElementById("theList"); var rows=t.getElementsByTagName("td"); var cells=t.cells; var bb=true; while(bb==true) { alert(bb); for(var i=1;i<rows.length;i++) { if(cells[td.cellIndex+i*4].innerText<cells[td.cellIndex+(i+1)*4].innerText) { ...

Working with html generated from javascript

Hello, I have some html-page. There is a javascript which generates some content. I have to parse this content from python-script. I have saved copy of file on the computer. Are there any ways to work with 'already generated' html? Like I can see in the browser after opening page-file. As I understand, I have to work with DOM (maybe, xml...

jquery - dom manipulation

I would like to show in dialog all elements with specific class. The dialog should hide the rest of the page. So for example: On this SO page I want to show all elements with class="user-info". Those elements would be shown in dialog with same width and height and same css and everything else would be hidden. It would be like cutting th...

Preventing a Firefox Extension's load event from triggering across tabs

Hi, I've been working on a Firefox extension that uses an iFrame to do some background scrapping. I have gone through a number of hoops to get it to trigger only once in the window/tab where it should but now when I open a different tab that tab triggers the load event. I found this: https://developer.mozilla.org/en/Code_snippets/Progr...

jQuery tooltip: Trouble with remove()

I'm using a jQuery tooltip plugin. I have HTML like this: <li class="term ui-droppable"> <strong>Fall 2011</strong> <li class="course ui-draggable">Biological Statistics I<a class="remove-course-button" href="">[X]</a></li> <div class="term-meta-data"> <p class="total-credits too-few-credits">Total credits: 3</p> ...

Best practice for inserting large chunks of HTML into elements with Javscript?

Hey guys. I'm building a web application (using prototype) at the moment that requires the addition of large chunks of HTML into the DOM. Most of these are rows that contain elements with all manner of attributes. Currently I keep a blank row of html in a variable and var blankRow = '<tr><td>' +'<a href="{LINK}" onclick="someFun...

How to access child div elements under a given condition with javascript?

My main question is to calculate the last alert message, but any other information is also welcome. I am trying to learn javascript (to use with greasemonkey later), but I am struggling a bit to grasp the DOM and how to process it. <html> <head> <script type="text/javascript"> function my_test() { var elements = document.getElement...

PHP Simple DOM Parser

Hi guys I'm using this wonderful class here to do a bit of code embed filtering: http://simplehtmldom.sourceforge.net/. It extends the PHP DOM document class. Pretty much what I am doing is parsing a string through this class that contains embed code, i grab the unique bits of information eg id, width, height send through a handler fu...

Need help accessing PHP DOM elements

Hey guys, I have the following HTML structure that I am trying to pull information from: // Product 1 <div class="productName"> <span id="product-name-1">Product Name 1</span> </div> <div class="productDetail"> <span class="warehouse">Warehouse 1, ACT</span> <span class="quantityInStock">25</span> </div> ...

opening a different webpage from my webpage and reading its content /clicking buttons etc

Hi friends, i was just curious as how to do this. i want to open www.whatsmyip.com or something similar from my webpage. put an ip address in the textbox in that page. click the button and read the value(suppose a textbox).. i want to achieve all this programtically without any humaninteraction.. how is that possible. ...

PHP DOMDocument getElementsByTagname?

This is driving me bonkers... I just want to add another img node. $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <gallery> <album tnPath="tn/" lgPath="imm/" fsPath="iml/" > <img src="004.jpg" caption="4th caption" /> <img src="005.jpg" caption="5th caption" /> <img src="006.jpg" caption="6th caption" /> </album> ...

PHP Xpath, help selecting a very specific node

Similar question from last night, I don't have access to edit the source HTML and I am attempting to parse a lot of data from a website to do product price/comparisons against. For the most part, it's working but I am now trying to make it more efficient, faster and easier to read my spaghetti code. I have the following test code; and w...

SVG Filters in Firefox

For some reason I can't get my SVG filters to work in Firefox. They work fine in Opera, however. The element whose property I set to the filter on just disappears. It's very odd. Here's my javascript code: defsElement = SVGDoc.createElement("defs"); var filterElement = SVGDoc.createElement("filter"); filterElement.setAttribute( "id", "...

How to add <font> with Javascript?

FM_log(3,"rp_insertTable() called"); var farmTable = dom.cn("table"); var ftableBody = dom.cn("tbody"); var i; var maximize = GM_getValue("Maximize_" + suffixGlobal, 0); farmTable.className = "FMtbg"; farmTable.id = "farmMachineTable"; farmTable.setAttribute('cellpadding', 2); farmTable.setAttribute('cellspacing', 1); f...

Dynamically moving div, like Yelp's moving map

I am trying to implement something very similar to Yelp's moving map. See: http://www.yelp.com/search?find_desc=restaurants&amp;ns=1&amp;find_loc=mountain+view%2C+ca Basically it starts off somewhere in the middle of the page, but if you scroll down far enough that you wouldn't be able to see it, it moves down as well. What is the be...

Anyone have a good solution for scraping the HTML source of a page with content (in this case, HTML tables) generated with Javascript?

Anyone have a good solution for scraping the HTML source of a page with content (in this case, HTML tables) generated with Javascript? An embarrassingly simple, though workable solution using Crowbar: <?php function get_html($url) // $url must be urlencode(d) { $context = stream_context_create(array( 'http' => array('timeout' => 12...

Strange offset space between <button> as parent container and <div> as child.

I need to decorate a standard html button. The base element I took <button> instead of <input>, cos I decided that the element must be a parent container. And there is child element <div> in it. This <div> element will be been the core element for decoration, and should occupy the entire space of the parent element - button. <button> <d...

jQuery how to set click on href in the div?

Good day, I want to set click event on every anchor element in my div container. Here is an example what I want to do: ---HTML--- <div id="my-container"> <a href="page1.html">page1</a> <a href="page2.html">page2</a> <a href="page3.html">page3</a> </div> ---- jQuery ---- $("#my-container a").click(function() { var link ...

How get <body> element from the html which one have as a string

Hello! I have a stupid problem. An jQuery.ajax request return me a full HTML text as a string. I receive such response in an case of error on the server. The server give me an error description which I want to place inside of the corresponding place of my current page. So now the question: I have a string contains full HTML document (w...

How to color a treeview node in javascript

i have a treeview and a texbox that allows a user to search for nodes inside the treeview. i already wrote the JS function that determines if a node exists in the treeview. what i want is to color the node that the user have searched for. how can i do this?? ...