setattribute

Using request.setAttribute in a JSP page

Is it possible to use request.setAttribute on a JSP page and then on HTML Submit get the same request attribute in the Servlet? ...

get one Attribute id, set as another Attribute id

I'm currently using scriptaculous and prototype to drag/drop elements from one div to another, and append a new Element based on the 'src' of the element that is dropped, creating a new draggable out of it. What I need to do is assign the id of the dropped element to the new one once it is created. I've tried a ton of different approac...

Google Chrome breaks when onfocus sets select size

The following javascript to resize a select list breaks in Google Chrome. It works when tabbing into the field, but clicking on it results in the "Aw, Snap!" error page. <select onfocus="this.setAttribute('size', 3);"> <option>selectList with onfocus</option> <option>2</option> <option>3</option> <option>4</option> </select> Works fin...

setAttribute, onClick and cross browser compatibility...

I have read a number of posts about this but none with any solid answer. Here is my code: // button creation onew = document.createElement('input'); onew.setAttribute("type", "button"); onew.setAttribute("value", "hosts"); onew.onclick = function(){fnDisplay_Computers("'" + alines[i] + "'"); }; // ie onew.setAttribute("onclick", "fnDis...

Why can't I disable this XUL menuitem?

I'm at my wits end, and it's probably something really simple.. But I've got basically this code: var menuitem = document.getElementById('mymenuitem'); alert(menuitem); alert(varImChecking == null); menuitem.setAttribute('disabled', (varImChecking == null) ? 'true' : 'false'); It should be disabling the 'mymenuitem' menu item, but has...

How to Set OnClick attribute with value containing function in ie8?

My goal is to change the "onclick" attribute of a link. I can do it successfully, but the resulting link doesn't work in ie8. It does work in ff3. For example, this works in firefox3, but not ie8. Why??? <p><a id="bar" href="#" onclick="temp()">click me</a></p> <script> doit = function(){ alert('hello world!'); } ...

Please guide me to set an attribute in XML node usig MSXML. I am struck.

I try to set an attribute in a XML node using MSXML. IXMLDOMElement alone has the member function setatrribute. So i got the document element. pXMLDocumentElement->get_documentElement(&pElement); pElement->selectSingleNode(nodePathString,&pNode); . . . pElement->setAttribute(bstr,var); I selected the required node inwhich the attrib...

set an attribute in XML node usig MSXML. I am struck

I try to set an attribute in a XML node using MSXML. IXMLDOMElement alone has the member function setatrribute. So i got the document element. pXMLDocumentElement -> get_documentElement (& pElement ); pElement -> selectSingleNode ( nodePathString ,& pNode ); . . . pElement -> setAttribute ( bstr , var ); I selected the required node i...

help with getElementsByTagName setAttribute and regex javascript

i want to put rel=lightbox to some links that mediabox support using javascript. i try this and wonder why it's not working? test: http://jsbin.com/opica please help edit this: http://jsbin.com/opica/edit <script type="text/javascript"> var x=xmlDoc.getElementsByTagName("a"); var regexku=/^.+(((twit)|(tweet)|(com/video.+)|(flickr.c...

Trigger effect after changing src attribute of img tag

Im using this code to change the src attribute of an image tag (using prototype and scriptaculous): new Effect.Fade("images",{afterFinish: function() { $("detail").setAttribute("src", "img/02.jpg"); new Effect.Appear("images",{duration:0.8}); } }); Where "images" is the container (a div) and "detail" is the img tag The result ...

HTML changes with element.setAttribute("onclick","alert('Test');") and element.onclick = "alert('Test');";

I got surprised when comparing the following cases: button = document.getElementById("addSugerenciaButton"); if (button != null) { button.onclick = "post_to_url('" + addSugerenciaURL + "', idBuzon', '" + id + "');"; } button = document.getElementById("removeBuzonButton"); if (button != null) { button.onclick = function() { ...

Javascript's object.onClick runs the function instead of setting onClick, how can I prevent that from happening and only execute the function onClick?

I have the following code: function sdefaults() { alert("test"); } var btnpos, sbtn; btnpos = document.getElementsByName('somePosition')[0]; sbtn = document.createElement('input'); btnpos.parentNode.insertBefore(sbtn, btnpos.nextSibling); sbtn.type = "button"; sbtn.name = "social"; sbtn.value = "Defaults"; sbtn.onClick = sdefaults()...

Insert created element at start of html tag using PHP DOM

Hi All, I'm trying to insert an HTML <base> tag immediately after the opening <head> tag of a page using dom. I've tried using appendChild which just inserts it before the </head> which is no good. Code im using: $head = $dom->getElementsByTagName('head')->item(0); $base = $dom->createElement('base'); $base->setAttribute('href', $url)...

cannot use HttpSession.setAttribute method when compiling via JavaCompiler tool library

I am using the following code to generate and compile java program inside another java program: import javax.tools.*; JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); compiler.run(null, null, null, "-classpath", classpath, souce_files_directory+"WebManager.java"); Inside the WebManager.java file I use regular HttpSesion m...

Modifying Existing XML Content in C#

Hello I found some examples about this subject. Some of the examples gived a method to modify attribute with SelectNodes() or SelectSingleNode(), and others gived the method to modify attribute with someElement.SetAttribute("attribute-name", "new value"); But I still confused that how to build the relation if I only used a XpathNodeItt...

getElementByClassName -> getElementsByTagName -> setAttribute

I want open certain links in a new tab. Since I can't set it directly into the a tag, I want to pot the link into span tags with a ceratin class name and set the target attribute via javascript. I thought this would be easy, but I can't get it working: addOnloadHook(function () { document.getElementByClassName('newTab').getElementsBy...

Using setAttribute with an array of Raphael paths

When 'things' in the following code is an array of paths... things.square = [ RM.path("m 154.21525,71.431259 74.32805,0 0,70.496711 -74.32805,0 0,-70.496711 z").attr(attr), RM.path("m 271.25132,77.933263 58.07304,0 0,56.409037 -58.07304,0 0,-56.409037 z").attr(attr2) ]; ...then this code does not work: things....

JavaScript setAttribute vs .attribute=

Hello! Is there a best-practice indication about using setAttribute instead of the dot (.) attribute notation? e.g. myObj.setAttribute("class","nameOfClass");      - and - myObj.className="nameOfClass"; OR myObj.setAttribute("id","someID");      - and - myObj.id="someID"; etc Thank you. ...

Internet Explorer "setAttribute" onclick workaround?

var tr = document.createElement('tr'); tr.setAttribute("onclick",p.onrowclick+"("+row.id+")"); Hi, the above works fine for me in Firefox. I can't find the correct syntax for a workaround in IE. I'm using IE8. ...