I've created a page demonstrating my problem/question (hope it helps!) http://www.ajaxify.org/jquery/
On Sep 8, 9:49 am, jeanluca <lca...@gmail.com> wrote: > :) you're right about the first thing, my mistake! > > ok, lets only focus on the second (I've modified it a little bit!!) > > $.ajax({ > type: "GET", > url: 'myxml.xml', > dataType: 'xml', > success: function(xml){ > alert( $("body", xml).html() ) ; // this cannot be > done!! > $("body").html( $("h1", xml).html() ) ; // insert it > } > }) ; > > suppose the xml file contains something like > > <myxml> > <body> > <h1> hello </h1> > </body> > </myxml> > > Is if, for example, possible to add functionality to the $ function ? > ps for example,http://james.padolsey.com/javascript/regex-selector-for-jquery/ > adds functionality to jquery selectors! > pps currently I've nothing online, but if it would still help, I'll > try to get something online as soon as possible! > > Hopefully this makes any sense! > On Sep 8, 2:31 am, Michael Geary <m...@mg.to> wrote: > > > Whoa, that's three things. (And the first one isn't even JavaScript.) > > > Could we get this down to one specific, concrete case that you want to > > solve? > > > I'm not very good at solving general problems that handle a lot of > > possibilities, but if there is one specific piece of code that you'd like to > > get working, and there's one particular missing link in it, I'm pretty sure > > I could help you find or code that missing link. But without actual data to > > look at, I don't have a way of testing any possible solution I might come up > > with. That means a link to a test page that shows what you're trying to do. > > > Now somebody else may come along who understands the problem better and can > > give you a good solution - that would be great and I would be off the hook. > > :-) but since I volunteered, I'm just saying what I need to understand it > > and try to help you solve it. Send that link and I'll be happy to take a > > look! > > > -Mike > > > On Mon, Sep 7, 2009 at 2:27 PM, jeanluca <lca...@gmail.com> wrote: > > > > suppose you could ask for an array of div's like: > > > > obj->get_me _all_divs() ; // --> gives an array with div elements > > > > Or: > > > > $.ajax({ > > > type: "GET", > > > url: 'myxml.xml', > > > dataType: 'xml', > > > success: function(xml){ > > > alert( $("body", xml) ) ; // this cannot be done!! > > > } > > > }) ; > > > > (In this case xml is een XML object and this doesn't work) > > > > or > > > > $.ajax({ > > > type: "GET", > > > url: 'myhtml.html', > > > dataType: 'html', > > > success: function(text){ // 'text' is a string > > > alert( $("body", text) ) ; // this doesn't seem to work > > > too > > > } > > > }) ; > > > > On Sep 7, 10:58 pm, Michael Geary <m...@mg.to> wrote: > > > > You need to explain a little more about what you want. If you've created > > > an > > > > object of your own, I don't think it will have "div" elements in it, > > > > will > > > > it? What *is* in your object, and what do you want to happen when you > > > > iterate over it? Could you give a complete specific example, with the > > > actual > > > > object that you want to use and the results you're looking for? > > > > -Mike > > > > > On Mon, Sep 7, 2009 at 1:04 PM, jeanluca <lca...@gmail.com> wrote: > > > > > > Hi All > > > > > > I need some help with the following: > > > > > > Suppose I have the following object > > > > > > var obj = new XYZ() ; > > > > > > Now I want to do: > > > > > > $("div", obj).each(function(){.....}) ; > > > > > > Now, of course, jquery will throw an error because it doesn't know > > > > > what to do with 'obj'. So I want to add/extend jquery, so it knows how > > > > > to treat 'obj'. Can this be done ? Is there documentation explaining > > > > > how to do this ? > > > > > > thnx a lot > > > > > LuCa