dom

generate HTML document server-side with jquery and classic asp

Here is my question, Would it be possible, knowing that classic asp support server-side javascript, to be able to generate "server side HTML" to send to the client like Response.write $(page).html() Of course it would be great to use jQuery to do it because it's easy to parse complicated structure and manipulate them. The only prob...

Javascript callback when IFRAME is finished loading?

I need to execute a callback when an IFRAME has finished loading. I have no control over the content in the IFRAME, so I can't fire the callback from there. This IFRAME is programmaticly created, and I need to pass its data as a variable in the callback, as well as destroy the iframe. Any ideas? EDIT: Here is what I have now: functi...

how can I scale the content of iframe

how can I scale the content of iframe (in my example is an html page), and is not a popup is in page of my web site? So I want for example to put the content that appears in iframe in for example 80% of the real size. Can someone help me please.... Thanks (question scraped from http://www.htmlcodetutorial.com/help/sutra32209.html) ...

JavaScript Table Manipulation

I have a table with one column and about ten rows. The first column has rows with text as row headers, "header 1", "header 2". The second column contains fields for the user to type data (textboxes and checkboxes). I want to have a button at the top labelled "Add New...", and have it create a third column, with the same fields as th...

How do I write content to another browser window using Javascript?

I've opened a new window with window.open() and I want to use the reference from the window.open() call to then write content to the new window. I've tried copying HTML from the old window to the new window by using myWindow.document.body.innerHTML = oldWindowDiv.innerHTML; but that's doesn't work. Any ideas? ...

How to remove only the parent element and not its child elements in JavaScript?

Let's say: <div> some text <div class="remove-just-this"> <p>foo</p> <p>bar</p> some text node here </div> some text </div> to this: <div> some text <p>foo</p> <p>bar</p> some text node here some text </div> I've been figuring out using Mootools, jQuery and even (raw) JavaScript, but couldn't get the idea how to do ...

Make DOM element effectively read-only

I'm writing a .NET forms control to edit HTML using MSHTML. I am creating some custom elements and want to make them effectively read-only. I thought I could go about this by focusing on the entire element any time focus entered anywhere in that element but the HtmlElement.Focus() doesn't select the entire element and I don't seem to b...

How can I modify a CSS file programatically?

I have a legacy application that I needed to implement a configuration page for to change text colors, fonts, etc. This applications output is also replicated with a PHP web application, where the fonts, colors, etc. are configured in a style sheet. I've not worked with CSS previously. Is there a programatic way to modify the CSS and ...

DOM Parsing

Anyone know how parse the DOM and determine what row is selected in an ASP.NET ListView? I'm able to interact with the DOM via the HtmlElement in Silverlight, but I've not been able to locate a property indicating the row is selected. For reference, this managed method works fine for an ASP.NET ListBox var elm = HtmlPage.Document.GetE...

How do I access the "displayed" text of a select box option from the DOM?

Given the following HTML: <select name="my_dropdown" id="my_dropdown"> <option value="1">displayed text 1</option> </select> How do I grab the string "displayed text 1" using Javascript/the DOM? ...

How do I iterate through DOM elements in PHP?

I have an XML file loaded into a DOM document, I wish to iterate through all 'foo' tags, getting values from every tag below it. I know I can get values via $element = $dom->getElementsByTagName('foo')->item(0); foreach($element->childNodes as $node){ $data[$node->nodeName] = $node->nodeValue; } However, what I'm trying to do, i...

PHP DOM: rather newbie question

I've just started tinkering with XML manipulation with PHP, and i've stumbled into something unexpected. Here's the XML i'm using as a test input: <list> <activity1> running </activity1> <activity2> swimming </activity2> <activity3> soccer </activity3> </list> Now, i was expecting that this PHP code would output 'activity1...

Inserting data in XML file with PHP DOM

I was trying to insert new data into an existing XML file, but it's not working. Here's my xml file: <list> <activity>swimming</activity> <activity>running</activity> <list> Now, my idea was making two files: an index page, where it displays what's on the file and provides a field for inserting new elements, and a php page whi...

Problems with deleting XML elements using PHP DOM

Here's the XML file i'm working on: <list> <activity>swimming</activity> <activity>running</activity> <activity>soccer</activity> </list> The index.php, page that shows the list of activities with checkboxes, a button to delete the checked activities, and a field to add new activities: <html> <head></head> <body> <?php ...

How to ensure a DOM element triggers mouseover when it contains a Flash object

I have a div that contains several child elements, one of which is a flash movie. When rolling over this div, I want it to change style to indicate it is rolled over. My problem is that the mouseover and mouseout javascript events don't always trigger, especially if the user moves the mouse over the flash element too quickly. Any sugge...

nearest ancestor node in jQuery

In my javascript experience, I found that is a very common task "searching the nearest ancestor of an element with some condition (tag name, class,...)". Can the parents() method of jquery do the job? The order of returned elements of parents() is predictable? Is top-to-bottom or bottom-to-top? For the moment I use this utility functio...

How should I add multiple identical elements to a div with jQuery

I need to add multiple empty divs to a container element using jQuery. At the moment I am generating a string containing the empty html using a loop divstr = '<div></div><div></div>...<div></div>'; and then injecting that into my container: $('#container').html(divstr); Is there a more elegant way to insert multiple, identical ele...

Create PHP DOM xml file and create a save file link/prompt without writing the file to the server when headers already sent.

I've created a PHP DOM xml piece and saved it to a string like this: <?php // create a new XML document $doc = new DomDocument('1.0'); ... ... ... $xmldata = $doc->saveXML(); ?> Now I can't use the headers to send a file download prompt and I can't write the file to the server, or rather I don't want the file laying aro...

jQuery and jVal Validation Plug-in. Adding an attribute to an element.

I'm trying to add the jVal attribute to a textbox that I created in the HTML. <input id="subJobName" type="text" jval="{valid:function (val) { return validateSubJobName(val); }, message:'Name already exists or is longer than 14 characters.', styleType:'cover'}" /> I would let to add /set the jVal in the javascript instead. 2 reasons ...

How do I constrain the size of a tooltip/popup-style DIV so that it doesn't trigger scrollbars on the page

The mouse hovers over an element and a tip appears. The tip overflows the page, triggering a scrollbar, which changes the layout just enough so that the underlying element that triggered the tip is no longer under the mouse pointer, so the tip goes away. The tip goes away, so the scrollbar goes away, and now the mouse is again over th...