search for: appendchild

Displaying 20 results from an estimated 103 matches for "appendchild".

2006 Jun 03
12
How to get dynamically created inputs from html form back to rails app
...etElementById ("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.appendChild(data); data = document.createElement("td"); node = document.createElement("input") node.setAttribute ("type","checkbox"); data.appendChild(node); row.appendChild(data); data...
2007 Aug 20
3
Contribution on extending createElement
...eate 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_element).appendChild(my_div); ... I guess you see what I''m talking about ! Back a few months, I wrote a function that would do all that in a one- liner. Since then, I''ve discovered Prototype so I rewrote my function in a more p...
2007 Apr 04
2
Simple RJS Calls Not Working
...ecipes/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.setAttribute(''name'', ''_method''); m.setAttribute(''value'...
2006 Jul 23
0
appendChild crashes ie6 onload (urget)
Has anyone encountered this problem before? A function which is attached to the window''s onLoad with Event.observe crashes ie6 ONLY when appendChild is called. I have confirmed it across multiple computers. Even weirder, the function in question is a well tested script commonly used. http://www.particletree.com/examples/lightbox I have eliminated all js on the page except prototype and lightbox, and it still crashes. Can someone please...
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
2008 Jul 12
1
<new Element> optimization
I have 2 problems with Prototype''s <new Element> method. 1. I have a lot of DOM elements created manualy with <new Element>. I have already about 1000 lines of code with just <new Element>. When I added it to the dome with <body.appendChild(root)> it takes a lot of time to insert. How to optimize it? May be it''s better to use simple HTML (may be with <new Template>) and then PUT in on DOM. But how? Is there any body.appendChild(HTML) method? As I can imaging appendChild takes a DOM element as a parameter ;-) 2. I n...
2005 Dec 28
1
Problem with IE
...solid #091C5A'', width:width, height:height }); nodoContenedor.setAttribute(''class'', ''elem_form''); nodoContenedor.appendChild(nodoNuevo); $(''formulario'').appendChild(nodoContenedor); nodoJs = Builder.node(''script'', {type:''text/javascript''}); nodoJs.innerHTML = "new Draggable(''div_"+id_elemento+"'', {revert:false})...
2007 Aug 25
2
insert HTML <select> value into a textarea - Works in IE6, not in FireFox or Opera
...e) With Opera 9.02, the select control doesn''t work at all. 1) Does prototype do anything "internally" differently for whatever it''s equivalent of var txtNode=document.createTextNode(selectValue); var textArea=document.getElementById(targetTextArea); textArea.appendChild(txtNode); is ? 2) Should I be using some other way of accessing the textarea other than the "appendChild" method? Any other ideas appreciated. Mike ============================== http://snippets.dzone.com/posts/show/4465 ======= This code DOES work in I.E6 (on my machine (XP pro),...
2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
...escription()); + # Export the new path + $path = $vol->get_path(); # Find any existing driver element. my ($driver) = $disk->findnodes('driver'); @@ -156,37 +155,24 @@ sub _storage_iterate $disk->appendChild($driver); } $driver->setAttribute('name', 'qemu'); - - # Get the volume format for passing to the qemu driver - my ($format) = - $voldom->findnodes('/volume/target/format/@type'); - -...
2008 Jul 01
5
Attaching event observers to a series of elements - best practice?
...lve 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 receive 3 as the parameter - the value of...
2009 Jul 07
10
link_to, how do you combine url options and html_options?
...o 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-forum.com/.
2006 Apr 06
0
Using insertion.after w/builder
...me: "title"}, "Sample Groupbox"); content = Builder.node("div", {className: "content"}, "This is a sample group box widget."); groupbox = Builder.node("div", {className: "groupbox"}); groupbox.appendChild(title); groupbox.appendChild(content); $("my_groupbox").appendChild(groupbox); } </script> I would like to use insertion.after instead of "$("my_groupbox").appendChild(groupbox);" to insert the DOM fragment I created w/builder. I...
2006 Apr 21
1
how-to pass other values to InPlaceCollectionEditor?
...ng to pass others paramenter to the function InPlaceCollectionEditor, but I think that is not possible I have modified some rows controls.js to line 782 from: ####################### this.editField = this.cached_selectTag; if(this.options.loadTextURL) this.loadExternalText(); this.form.appendChild(this.editField); this.options.callback = function(form, value) { return "value=" + encodeURIComponent(value); } ####################### to: ####################### var extra_param = this.options.extra_param; //a.alonzi this.editField = this.cached_selectTag; if...
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
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.
2006 Apr 06
4
problem with IE
...CODE //// var m = $(''XYZ'').cloneNode(false) m.setAttribute(''id'', ''XYZ_2''); m.value = ''''; var onblur = "alert(''hola'');"; m.setAttribute(''onblur'', onblur); y6.appendChild(m); //// CODE //// where "XYZ" is an input text and y6 is a TD cell, this works perfectly in firefox, but i dont have idea why doesnt work in IE, any clue?? thx in advance :) -- // // Ing. Francisco J. Calderón S. // fjcalderon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org // Usuario d...
2015 Sep 24
0
php DOMDocument and entities
...e 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'); $xslvalueof->setAttribute('select', '../@year'); $caption->appendChild($xslvalueof); That's w...
2007 Jan 11
2
In-place editor for a whole form?
I want to implement in-place editing for a hierarchical structure where the nodes are not simple text fields, but need to be represented by at least two input elements. The Rails helpers only support in-place editing for a text field, scriptaculous''s controls.js beyond that implements support for an in-place editor containing a select element. I need an editor where I essentially
2009 Jul 16
2
[PATCH server] updated anyterm/ovirt integration
...f (confirm('Click OK to "type" the following into the terminal:\n'+p)) { + process_key(p); + } +} + + +function create_button(label,fn) { + var button=document.createElement("A"); + var button_t=document.createTextNode("["+label+"] "); + button.appendChild(button_t); + button.onclick=fn; + return button; +} + +function create_img_button(imgfn,label,fn) { + var button=document.createElement("A"); + var button_img=document.createElement("IMG"); + var class_attr=document.createAttribute("CLASS"); + class_attr.value=&q...
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! _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs