search for: getelementsbytagname

Displaying 20 results from an estimated 85 matches for "getelementsbytagname".

2006 Jun 28
3
Add to enumerable
This might seem like a really daft question, but I couldn''t find an answer anywhere. How do you add something to an enumerable object? Something like var first = $A(getElementsByTagName(''td'')); var second = $A(getElementsByTagName(''tr'')); first.PUSH(second); where the PUSH is something unknown. am i supposed to use inject here in some way? Andreas
2011 Sep 14
5
rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
...oyee_name'').value);''%> </div> <% end %> when i click tab it calls sal() jquery function and i sent the data to action, in action parameter is processed well, but while replacing div with partial page i am getting following error like RJS error: TypeError: element.getElementsByTagName is not a function Element.update("upc_search", "\n \n <div >\n <table border = \"1\">\n <tr>\n <th>\n <label >No</label> \n <br />\n <input tyep=\"text\" valu...
2007 Oct 03
1
Form getElementsByTagName("*") is empty
I''m having problems serializing a form. I''ve narrowed the problem down so that if I break in Prototype''s getElements function, and trace into the $A that makes an array of the return of $(form).getElementsByTagName("*"), the iterator doesn''t contain any elements. However, looking at the form variable in FireBug shows all the elements I''d expect to be there. I''m executing the getElements from within an onChange handler on a SELECT element in Firefox 2 if it''s impo...
2008 Mar 25
4
Prototype: toggle() not supported on TD in IE?
The following line causes trouble both with IE 6&7: cels[i].toggle(); It tells me that this element does not support the property or method. The element is a cell (TD) which I checked by outputting the tagName and it works with FF, Opera and Safari. The IE script debugger stops at this line but I didn''t find a single posting on the net with a similar problem which is kind of strange.
2006 May 24
6
enumerables problem?
I was wondering whether anybody could please tell me why this is causing an error in IE (works in Firefox): $A(container.getElementsByTagName(''*'')).each( function(el) { Element.cleanWhitespace(el); }.bind(this)); What would be an alternative of achieving the same? Thank you Marco M. Jaeger | Url: http://mmjaeger.com <http://mmjaeger.com/> | E-mail: mail-yVS5avHIROZWk0Htik3J/w@public.gmane.org Do you...
2006 Nov 03
4
Bug? IE, getElementsByClassName and "length"
...there is an input on the page with ''name="length"''. Solutions: Change the name of the input, or use the optional parent argument to avoid it. More: Looking at the getElementsByClassName declaration in prototype.js, I''d guess this is really a problem with $A or getElementsByTagName, but that''s as far as I got. Demo: http://www.thewehners.net/joshua/test_ie_length.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send...
2007 Jul 18
3
immediate Descendants not working in IE
Hi, im currently styling a menu using a java script effect which hides the nested submenus on load, and also shows/hides them on mouseover. It is working in firefox, using ... var ul = $("nav").getElementsByTagName("ul")[0]; var lis = ul.immediateDescendants(); I then loop through lis to initially hide all the submenus. This works fine in firefox, but not in IE. The sub menus are still visible when the page loads?! Any ideas? --~--~---------~--~----~------------~-------~--~----~ You received th...
2006 Jan 03
7
link_to an external url ?
Simple question. Is it possible to generate a link like <a href="http://www.google.com" target="_blank" >google</a> with the link_to function ? Thanks
2005 Nov 08
1
Event.observers - I''m totally list - please help
...;button"> <img src="images/spacer.gif" width="20" height="20"> </li> </ul> </div> I have a little unordered list like the one above. This is the code that is working: /* navigation bar */ var x = $(''nav'').getElementsByTagName(''LI''); for (var i = 0; i < x.length; i++) { if (x[i].className == ''fm-navbtnUp'') { x[i].onmouseover = _btnOver; } } function _btnOver() { alert(this.nodeName); } This is the prototype way: /* navigation bar */ var x = $(''nav'').g...
2005 Nov 24
1
Extended $ function called $$
...div.whatever","#firstname,#lastname#,.bolded"); Note that I actually broke all my own code. I used a format that was a little tighter but a lot less standard CSS. This format as shown adheres pretty closely to the standard used in most browsers. Here is the code: // equivalent to getElementsByTagName("*") but should work for all browsers. Element.getDescendants = function(el){ // browser searching ugliness necessary. msie supports getElementsByTagName // but fails when passing in "*" for some versions. Safari fails too. // Because of this, we need to walk DOM for fail...
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.
2005 Nov 07
2
IE vs. Firefox - little programming help needed
Hello, I was wondering whether somebody can give me a little hand on this: I have the following code: "var img = this.el.previousSibling.getElementsByTagName(''IMG'')[0];" While IE correctly returns the image object, Firefox returns an error. What I discovered so far is that this.el.previousSibling returns the DIV tag an IE which is correct - however, Firefox returns this: #text. I was wondering whether there is some use of the...
2006 Mar 03
6
[PATCH] Effect.Accordion (not from the wiki)
Hello boys and girls In the ever-loving spirit of OSS, here''s another feature for s.a.u. In particular it''s called Effect.Accordion, and is a scriptaculified version of openrico''s Accordion. Work in progress, I''ll submit further modifications as the come in, but this is 90% of what needs to be done. I anticipate some bugs when I start using it more. Tested
2009 May 31
7
[mapstraction commit] r11 - Added functionality to automatically load scripts needed.
...+3,56 @@ // holds all our implementing functions var apis = {}; + // ''Constructor'' + (function() { + // Defaults + var providers = ''google,yahoo,microsoft''; + var modules = ''core''; + var scriptBase; + var scripts = document.getElementsByTagName(''script''); + + for (var i = 0; i < scripts.length; i++) { + var match = scripts[i].src.replace(/%20/g , '''').match(/^(.*?)mxn\.js(\?\(\[?(.*?)\]?\))?$/); + if (match != null) { + scriptBase = match[1]; + if (match[3]) { + var settings = match[3...
2006 Mar 17
10
good javascript xml parser
Anyone know of a javascript function that will take an xml document and turn it into an associative array? Basically it would take something like this: <body> <item> <id>1</id> <name>Bob</name> </item> <item> <id>2</id> <name>John</name> </item> </body> And turn it into something like this: {
2006 Feb 09
3
each()
I have been reading the documentation at: http://www.sergiopereira.com/articles/prototype.js.html One of the examples does this: var someNodeList = $(''lstEmployees'').getElementsByTagName(''option''); var nodes = $A(someNodeList); nodes.each(function(node){ alert(node.nodeName + '': '' + node.innerHTML); }); How can I access the array index as well as the node value? The reference mentions that the Enumerable.each() function (I assume this is...
2008 Jan 19
1
Set Return Type XML in Prototype
...xmlDoc.load(xmlHttpRequest.responseText); //alert(xmlDoc); xmlDoc.onload=getmessage; } catch (e) { alert("death setting onload\n" + e); } } else { alert(''Your browser cannot handle this script''); } } function getmessage() { alert(xmlDoc.getElementsByTagName(''title'').length); var x=xmlDoc.getElementsByTagName(''title''); for (i=0;i<x.length;i++) { alert("Title [" + i + "] :" + x[i].childNodes[0].nodeValue); } var x=xmlDoc.getElementsByTagName("book"); alert(x.length); for(i=...
2006 Aug 17
2
link_to_remote option :onsuccess, execute js function
...links to class ''raised'' the search is correct, but links classes don''t toggle, as my :success option seems to be incorrect.... my js function toggle a button to simulate radio type buttons function toggleButton(elementObj, idRegex) { var arraySpans = document.body.getElementsByTagName("SPAN"); for(var i = 0; i < arraySpans.length; i++) { if(arraySpans[i].id.match(idRegex)) { arraySpans[i].className = ''raised''; } } elementObj.className = ''depressed''; } -- Posted via http://www.ruby-forum.com/.
2005 Oct 18
4
responseText Vs responseXML
This is a newbie question. If I have a xml file that I am opening using Ajax.Request, then the response is trapped using responseText. Now this response is a set of xml tags, if I need to traverse through it using DOM, I am not able to use the getElementByTagName method? If I write my own ajax function, then when I do t.responseXML.getElementByTagName(''items'') it works but
2005 Sep 18
3
Attaching effects during onload
...ct to apply to. Here''s what I''m trying to do: function doOnLoad() { var filters = document.getElementsByName(''filter''); for (var i = 0; i < filters.length; i++) { var filter = filters[i]; var trigger = filter.getElementsByTagName(''a'')[0]; //trigger.onclick = function() { new Effect.SlideUp (filter); } trigger.onclick = function() { filter = this.parentNode.parentNode.parentNode; Effect.SlideUp(filter); } } } The troubl...