[jQuery] Re: Generating path
Oh I see! Thank you :)... mkmanning wrote: > ul has a previous sibling (the h1); I suspect there's a head tag > that's the body's previous sibling. In both cases then, prevAll() > would result in a length of 1. > Also I assume you meant the second paragraph, which starts with "In > addition to this the earth". > > On Jul 9, 12:27 am, Shashank wrote: > > Hello, > > > > I have an HTML page where when user clicks on a paragraph I want to > > find out its path. I have written a jquery script for it: > > > > jQuery.fn.extend({ > > getPath: function( path ) { > > // The first time this function is called, path won't be > > defined. > > if ( typeof path == 'undefined' ) path = ''; > > if ( this.is('html') ) > > return '/html' + path; > > // Add the element name. > > var cur = this.get(0).nodeName.toLowerCase(); > > var index = this.prevAll().length; > > // Recurse up the DOM. > > return this.parent().getPath( '/' + cur + '[' + index + ']' + > > path ); > > } > > > > }); > > > > On an html page like this > > > > Testing > > > > > > Except when the winds rise to a high speed, we seem to > > live in a very tranquil world. > > In addition to this the earth revolves round the sun > > at a speed of more than a thousand miles a minute. > > > > > > Circling round the earth, in the same way as the earth > > circles round the sun, is our moon. > > > > > > > > > > Clicking on the second paragraph "Except when the winds..." generates / > > html/body[1]/ul[1]/li[0]/p[1]. I am not getting why body and ul have > > index 1. Please help. Sorry for the long mail.
[jQuery] Generating path
Hello, I have an HTML page where when user clicks on a paragraph I want to find out its path. I have written a jquery script for it: jQuery.fn.extend({ getPath: function( path ) { // The first time this function is called, path won't be defined. if ( typeof path == 'undefined' ) path = ''; if ( this.is('html') ) return '/html' + path; // Add the element name. var cur = this.get(0).nodeName.toLowerCase(); var index = this.prevAll().length; // Recurse up the DOM. return this.parent().getPath( '/' + cur + '[' + index + ']' + path ); } }); On an html page like this Testing Except when the winds rise to a high speed, we seem to live in a very tranquil world. In addition to this the earth revolves round the sun at a speed of more than a thousand miles a minute. Circling round the earth, in the same way as the earth circles round the sun, is our moon. Clicking on the second paragraph "Except when the winds..." generates / html/body[1]/ul[1]/li[0]/p[1]. I am not getting why body and ul have index 1. Please help. Sorry for the long mail.
[jQuery] Unsubscribe
Unsubscribe From: jquery-en@googlegroups.com [jquery...@googlegroups.com] On Behalf Of Dave Roberts [dave.a.robe...@gmail.com] Sent: Monday, March 16, 2009 1:41 PM To: jQuery (English) Subject: [jQuery] Form Plugin data return type Hello, I'm trying to submit a form via Ajax and receive a JSON return type http://imgur.com/2KZ1.png As you can see in the screen shot, I call the method ajaxForm, and on success of the ajax call, processJson is being invoked. This method only outputs a data.message alert. For some reason, the message is always "undefined". I am showing a screen shot of my Firebug debugging, showing that the variable data is indeed populated with the data I have. What am I missing?
[jQuery] Re: JQuery XML Manipulation
I want to manipulate the xml after the user has modified some values on the grid. Say for instance, when user clicks on the grid row, a modal window opens where user makes some changes. On Clicking save, I want to extract the XML of the grid row & send it to the server. Shashank From: jquery-en@googlegroups.com [jquery...@googlegroups.com] On Behalf Of Tony [t...@trirand.com] Sent: Friday, March 13, 2009 6:05 AM To: jQuery (English) Subject: [jQuery] Re: JQuery XML Manipulation Hello, You can use a datatype parameter as function. This way you can manipulate the xml before send them to the grid. Refer to the documentation and examples on how to do this. Regards Tony On Mar 13, 1:10 am, stilwalli wrote: > Hello Developers, > > I am usingjqGridplugin of JQuery for displaying data in a grid. I am > wanting to manipulate the data xml dynamically. For instance say I have an > xml like > > > > 10 > raj > > > 20 > caj > > > > > Now when I say add row, I would like to add an data to the row (which I am > able to do it). But I am not able to get the updated xml. For instance If I > add data with empcode as 30 & name as abc > > > > > 10 > raj > > > 20 > caj > > > 30 > ABC > > > The idea is to get the maniupulated xml data & then sent it to the server... > Please help > > > > -- > View this message in > context:http://www.nabble.com/JQuery-XML-Manipulation-tp22448894s27240p224488... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.