search for: createelement

Displaying 20 results from an estimated 82 matches for "createelement".

2006 Jun 03
12
How to get dynamically created inputs from html form back to rails app
...The following javascript is the code that inserts the new row into the table in the browser context (not the backing RDBMS): function insertAnswer () { table = document.getElementById ("answersTable"); body = document.getElementById ("answersBody"); row = document.createElement("tr"); row.setAttribute("id",""); // need to build a Ruby friendly naming scheme for // elements so they can be passed as parameters data = document.createElement("td"); row.appendChild(data); data = document.createElement("td"); row....
2007 Aug 20
3
Contribution on extending createElement
Hi all, I work a lot with scripts that modify the DOM, and I have always found quite annoying that the code would always get very verbose as soon as I wanted to create even simple structures : var my_div = document.createElement(''div''); var my_anchor = document.createElement(''a''); my_anchor.setAttribute(''href'',my_link); var my_text = document.createTextNode(''here is my link''); my_anchor.appendChild(my_text); my_div.appendChild(my_anchor); $(document_el...
2007 Apr 04
2
Simple RJS Calls Not Working
...t;tags", "<tr>\n <td>Please Work</td>\n <td><a href=\"/recipes/6/tags/28;edit\">Edit</a></td>\n <td><a href=\"/recipes/6/tags/28\" onclick=\"if (confirm(''Are you sure?'')) { var f = document.createElement(''form''); f.style.display = ''none''; this.parentNode.appendChild(f); f.method = ''POST''; f.action = this.href;var m = document.createElement(''input''); m.setAttribute(''type'', ''hidden''); m.setAttr...
2009 Aug 06
2
robots.txt
Hi all, I have again noticed that the wiki does not really show up in search results and wonder if it has any impact that robots.txt on wiki.centos.org is empty. Perhaps it should at least contain User-agent: * ? Best Regards Marcus
2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
...t acpi under KVM. ACPI ". - "will be disabled."); - $feature->getParentNode()->removeChild($feature); - } - } - } - - # Add a features element if there isn't one already - else { - $domfeatures = $dom->createElement('features'); - my ($root) = $dom->findnodes('/domain'); - $root->appendChild($domfeatures); - } - - # Add acpi support if the guest supports it - if ($guestcaps->{acpi}) { - $domfeatures->appendChild($dom->createElement('acpi'));...
2006 Jun 15
8
Loading CSS for AJAX apps.
I am working on an update to my content management system and I am using a lot of AJAX to load in the different "Modules" I want each module to be self contained, including all its specific js and CSS. Does any one know of a good solution for loading in new CSS to go with the code loaded in via the AJAX call? Thanks.
2009 Jul 07
10
link_to, how do you combine url options and html_options?
...As far as I can determine, the api documents do not explicitly show this case either. What I want link_to to generate is: <a href="/objects/new" class="css_class" id="css_id" onclick="if (confirm(''Press OK'')) { var f = document.createElement(''form''); f.style.display = ''none''; this.parentNode.appendChild(f); f.method = ''POST''; f.action = this.href; f.submit(); }; return false;">link here</a> How is this done? -- Posted via http://www.ruby-fo...
2006 Jun 27
14
iframe ... does it have an innerHTML ?
If I dynamically create a hidden iframe, how could I add a document in a string to that element? e.g., var sDocument = ''<html><head></head><body>Hello world.</body></html>''; I''ve tried several variations of appendChild, innerHTML, document.innerHTML, createTextNode. Argh! _______________________________________________
2008 Jan 22
3
dynamic table/adding rows in IE using 'new Element("tr")'
I''m trying to create a few menus using prototype.js "insert" function. I create a table using ''new Element("table")'', insert it in DIV and then add links - one row per link (or the other way round - create a full table, then insert it). I initially wrote a code that worked fine in Firefox, but did not in IE (currently testing with 6.0): function
2015 Sep 24
0
php DOMDocument and entities
This is not CentOS specific but I hope someone here knows so I do not have to subscribe to another list. I'm using php DOMDocument to create an XSL that needs a non-breaking space between two values. Basically: $xslvalueof = $dom->createElement('xsl:value-of'); $xslvalueof->setAttribute('select', '../@month'); $caption->appendChild($xslvalueof); $nbsp = $dom->createTextNode('&#160;'); $caption->appendChild($nbsp); $xslvalueof = $dom->createElement('xsl:value-of');...
2005 Oct 05
5
InPlaceEditor crash on Safari
Quick question.. I often crash my Safari when using ''Enter'' on InPlaceEditor''s for submitting. Works fine on firefox(win & Mac) - no javascript errors. Anyone else seen this behavior? (Maybe it is just my alterings of InPlaceEditor :-) Best Regards Michael Krog
2006 Apr 27
5
proposing $E & $T
...(string) as $T() - return text node element Does just what it says... I''m sure someone could extend it nicely when via Prototype. (example) var x = $T(''hello world''); xElement(tagname) as $E() - return DOM element * return element, when tagname is a string - via ".createElement()" * return (deep) clone, when tagname is already a DOM element $E processes extra arguments for generating DOM trees... * When extra argument is an element reference, it''s appended to output * Extra string arguments become attribute/value of output. * [Exception] When the only extra...
2008 May 19
6
obtaining table cell text data
I''m writing some code to subset a table based on the contents of particular columns. My event handler starts off like this: subsetChange: function(e) { var subset = $F(''subsetSelector''); var rows = $$(''.content-row''); rows.each(function(row) { var value = row.down(''.Platform_Category'').childNodes[0].data;
2006 May 19
6
Multiple dynamic Sortables
I''m writing an appliation that contains several dynamically created lists. I had hoped that the following method for using the Sortable library from scriptaculous would work: 1) create the list 2) create a Sortable for it 3) create another list 4) create a Sortable for it and so on. Unfortunately this doesn''t work. I can''t find any info in the documentation for
2008 Jul 01
5
Attaching event observers to a series of elements - best practice?
...en''t found an elegant way to solve the problem. This won''t work: function populateContactsList( contacts ) var theUL = document.getElementById("addr-book-index"); var thisLI = null; for ( var i = 0; i < contacts.length; i++ ) { thisLI = document.createElement("li"); thisLI.appendChild( document.createTextNode( contacts[i].name ) ); theUL.appendChild( thisLI ); Event.observe( thisLI, "click", function() { openContact( contacts[i].id ); } ); } } ...because every call to openContact() will rec...
2010 Jun 24
4
[LLVMdev] Hello World
...releasing it), but since I'm fairly new to the whole thing, there are still a number of things I'm not too sure about. First, the way we create instructions confuses me a little. My best experience with factory-like patterns is the JavaScript DOM interface, where you'd do like document.createElement, mess with the new element, then put it back somewhere doing node.appendChild. However, seeing the results from llvm2cpp, it looks like simply creating an instruction is enough to put it somewhere (at the end of the specified basic block, I suppose) unless no parameter is specified. Skimming throug...
2006 Dec 13
4
Effect.Opacity on Firefox Mac Dims text
Hey everyone, I have a series of thumbnails that have a loading overlay placed over them when they''re clicked on. The overlay is set to an opacity of .7.. .The onclick code looks basically does this: var loading = document.createElement(''div''); loading.id = ''loading_image''; $(loading).addClassName(''thumb_loading''); $(''container'').appendChild(loading); Position.clone($(''myThumbnail'').parentNode,$(''loading_image'')); new Effect...
2008 Jun 15
11
[PATCH] helper to create fb css stylized table
I attached a rails helper implementation of the fb_table described here: http://wiki.developers.facebook.com/index.php/Facebook_Styles I included testing and comments. I hope you find it useful. Curiously, it''s really a small extension of FBML. Richard -------------- next part -------------- Index: test/rails_integration_test.rb
2011 Mar 11
2
[PATCH 1/2] Allow reading more data than the reported size of a volume
If a volume is not an exact multiple of 512 bytes, qemu-img will report its size rounded down to a 512 byte boundary. However, when copying, the file is still read until EOF, which will return more data than was expected. This change prevents that causing a failure in itself. The situation is still not resolved, however, as there are still situations where this will cause a failure. For example,
2006 May 05
0
Node wrapping, node replacement, magic buttons...
...<span id="myElement">My element text</span> And I want to wrap myElement with another node like this: <div><span id="myElement">My element text</span></div> The only solution I found was to do something like this: var myDiv = document.createElement (''div''); $(''myElement'').parentNode.insertBefore (myDiv, $(''myElement'')); myDiv.appendChild($(''myElement'')); Does anyone have a more elegant solution than this? Along the same lines, a replace node method: var myDiv = do...