elements

XML Namespace is required ?

Hello everybody I am learning xml and xml processing.I couldn't understand existence of namespace well. I learn that Namespace help us seperate same named elements in xml.Can't we discriminate elements by attributes which has same name ? Why namespace is important or required ? I want to give an example: <persons> <person></person>...

C# linq-to-xml, Getting a list with nodes?

Hi! This is the test xml that i am using: <categories> <category id="1" name="Test1"> <category id="2" name="Test2"> <misc id="1"></misc> </category> </category> <category id="3" name="Test3"> <misc id="2"></misc> </category> Now i want to bind that to an ASPX treeview, i want only the elements that have...

jqGrid : child-element ids can conflict when more than one grid appears on page: is there a setting to avoid this?

When you have more than one jqGrid on the page at the same time, their child-element ids can conflict. You might want to have three or four identical grids stacked one above the other, showing the same data but from different years. Child-element ids should have the table-id prepended to them. Is there a "fully-qualified|verbose ids" se...

Is there a fast way to check if a variable belongs to a set?

Hi, I have a form and I need to check if a input belongs to enum(0,1,2,3,..,n) Is there a simple way to check if my variable belongs to the set [0:n] ? Or do I have to write each condition (basically n<10, so it's feasible but not that practicle...)? If there ain't native function to do that, could you give me a hint on how to make a f...

Javascript: Show/Hide multiple elements by name

I need to show/hide multiple elements with the same name when another element is clicked, like <span name="showhide" value="one" id="button">Click to Hide One</span> <span name="showhide" value="two" id="button">Click to Hide Two</span> <span name="showhide" value="shoe" id="button">Click to Hide shoe</span> would hide the elements with ...

Same jQuery function for multiple form elements. How do I consolidate

I have this need to show and hide a div if a checkbox is checked for multiple checkboxes. Each div's id that needs to be shown will be the same as the checkboxes name. Is there an easy way to accomplish this without writing a function to handle each checkbox? $('input[name=checkbox_1]').click(function() { if ($('input[name...

regex to find tag id and content JavaScript

Hey I'm trying to do something quite specific with regex in javascript and my regexp-foo is shakey at best. Wondered if there were any pros out there who could point me in the right direction. So I have some text... <item id="myid1">myitem1</item> <item id="myid2">myitem2</item> ...etc And I would like to strip it out into an array t...

Get away with built-in draging html elements.

I have a problem with html-objects that moving when I´m dragging them, you know the transparent "ghost" -copy of the element that appears when you holding down the mouse and drag it. My problem is that it interrupt my mouse event. I have a image that should be able to move inside a div when you draging it with the mouse. I have to events...

Insert Element within specific tags

Hi, I'm trying to insert an element at a specific point within my file, then save that file out. However, I can't seem to get it right. My XML layout is like this: <?xml version="1.0" encoding="utf-8"?> <Settings> <Items /> <Users /> </Settings> This is my current code: XDocument xd = XDocument.Load(@"C:\test.xml...

Unique identifier for HTML elements

Besides of the ID, if you say, you want a unique identifier for an HTML element (let say a div). I browsed the DOM for something (like a number or string) that is unique for each element; but the DOM is big and I failed to find that in the Internet. Is there any property (in the DOM obviously) that is unique only to that element? (Othe...

Using layouts/elements in Cakephp

Hello all I am developing a webapp using Cakephp. I have created a default layout for the website. I created sections like header, footer, content. Now some of the pages in my content section have same structure. These are part of a controller with various views defined for each page. What view template should I be using here? Layouts ...

jQuery: array of elements to raw html?

Let's say I have an array like this: var content = [ $('<p>...</p>'), $('<p>...</p>') ]; I need to get the markup of the concatenated elements. So I need to convert content" into a raw string: "<p>...</p><p>...</p>". How can this easily be done? Seems like there should already be something in the framework to do this. Somehow maybe ...

where is the documentation listing the elements that are targets for touch events in iPad?

I have been looking for a list of HTML elements that are valid targets for touch events on the iPad but haven't found it in the online Apple documentation for handling touch events. I know that a span element can be turned into a touch target by adding a dummy onclick handler, but that trick doesn't work for all elements. I would be ve...

Get specific elements of a website displayed in firefox

Hello, I use a screenshot tool like SnagIt and this tool is able to make a screenshot of a specific element inside a website. I tried this feature with firefox, safari and ie, all runs fine. When I use the mouse pointer to aim an element, SnagIt shows a red box around the hovered element in the browser. For example, this tool knows the ...

jQuery binding live events

Hi I am having troubles binding live events to dynamically created content. I have a page which loads a html page through an ajax call. The loaded html page contains some javascript which is then executed. The executed javascript creates some elements. I want to bind a click event handler to those elements, however after binding them ...

iPhone scrollView add elements dynamically with id

Hey guys, I want to populate a scrollView with quite a few different UI elements. Therefore I thought I would write a method that remembers the current Position in the scrollView and just adds the element to the scrollView at the current Position. Something like: - (void)addUIElement:(id)element withWidth:(CGFloat)width andHeight:(...

Javscript/jQuery Click Element within Element

Hello, This is probably something quite easy to resolve, but for some reason, I can't figure it out. I have the following HTML: <li onclick="function_1();"> <input type="checkbox" onclick="function_2();"> <div onclick="function_3();"> </li> My issue is: Whenever I click one of the child elements (either the checkbox or div), it ...

Moving a DIV element to bottom of parent (as last child)

I'm trying to create a continually rotating banner for the top of the homepage of a site I'm developing. The best way that I can figure to keep it constantly in rotation is to take the first DIV (firstChild) and move it to the end of the stack once it's slid out of view. This: <div id='foo0'></div> <div id='foo1'></div> <div id='foo2'>...

Display a page's elements as selectable (HTML/PHP)

Hello :) I am looking for a way to make all visible objects in a webpage selectable by a visitor. For example, I take google's homepage as source, my php script already gets the homepage, and stores everything in an array. Now I want to show the google homepage with every object (span, div, body, td etc...) selectable. My visitor wil...

Mapping HTML5 elements to HTML classes and IDs, but what about header tags?

Hello, at work we're starting to follow this particular guide for slowly implementing HTML5 goodies: http://oli.jp/2008/html5-class-cheatsheet/ The basic idea of using HTML5 structure, but with HTML4 divs with classes and IDs instead. We're aware of Javascript scripts that can genearate the require HTML5 elements (so IE can actually st...