[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan
Glad I could help. I haven't seen this problem before even though it does seem like quite a common thing to need to do. I think with a bit more work you could come up with a more elegant work around such as using the append/prepend function in conjunction with say the and tags. Although whatev

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
You are right, that did work. Thanks, I really appreciate your help on this! Had you run into this issue before? On Apr 13, 3:33 pm, Ryan wrote: > In my tests wrapping your full test html page in the div seems to > work. Not pretty but works. > > On Apr 13, 11:29 pm, Nic Hubbard wrote: > > >

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan
In my tests wrapping your full test html page in the div seems to work. Not pretty but works. On Apr 13, 11:29 pm, Nic Hubbard wrote: > Yeah, but my page returns a full HTML page, so I need to do something > like: > > $("body").wrapInner(''); > > Which, does not seem to work. > > On Apr 13, 3

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
Yeah, but my page returns a full HTML page, so I need to do something like: $("body").wrapInner(''); Which, does not seem to work. On Apr 13, 3:14 pm, Ryan wrote: > In that case you would need to add something like > > html = ''+html+''; > > to your function. Its a bit of an ugly hack I know.

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan
In that case you would need to add something like html = ''+html+''; to your function. Its a bit of an ugly hack I know. Having played with it a bit now. I think your probably right about it being a jquery bug. It might be worthwhile exploring which function the problem lies with then submitti

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
Hey, that actually worked! But, why would this have helped? And, is there a way around this, since the real form that I need to get, I cannot wrap a div around. On Apr 13, 2:46 pm, Ryan wrote: > If you wrap your form in a div I think it should work - haven't tested > it > > R > > On Apr 13, 10

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan
If you wrap your form in a div I think it should work - haven't tested it R On Apr 13, 10:22 pm, Nic Hubbard wrote: > Could this be a jQuery bug? > > On Apr 13, 2:13 pm, James wrote: > > > I still haven't figured it out, but playing around and setting the > > ajax response as a jquery objec

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
Could this be a jQuery bug? On Apr 13, 2:13 pm, James wrote: > I still haven't figured it out, but playing around and setting the > ajax response as a jquery object, $(html), and making it global so I > can view it's attributes through Firebug, I was able to locate the > form element on the ajax

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread James
I still haven't figured it out, but playing around and setting the ajax response as a jquery object, $(html), and making it global so I can view it's attributes through Firebug, I was able to locate the form element on the ajax response. It was the index-5 element for your test page. My sample cod

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread finco
Just a guess here - is it possible that jquery will not recognize nodes that are loaded after the document is first rendered? Do you need to rebind? On Apr 13, 4:28 pm, Nic Hubbard wrote: > Ok, my test now reflects your suggestions.  But, sadly, none of that > helped, it is still returning unde

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
Ok, my test now reflects your suggestions. But, sadly, none of that helped, it is still returning undefined. :( On Apr 13, 1:03 pm, Nic Luciano wrote: > Hey Nic, > > I have a couple small recommendations- hopefully one will fix the issue. > > Try using $.get() instead of $.ajax, and specify "ty

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Luciano
Hey Nic, I have a couple small recommendations- hopefully one will fix the issue. Try using $.get() instead of $.ajax, and specify "type" option as "html"- alternatively, you can use $.load() if your ultimate purpose is to inject this HTML into DOM. In addition rather than using find(), just sel

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
Nope, that does not work either. On Apr 13, 12:20 pm, Jack Killpatrick wrote: > Maybe try: > > success: function(html){ >   alert($(html).find('form').attr('action')); > > I had some issues in the past using form id's with the jquery form > plugin, but usually getting it using 'form' worked. > >

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
Yes, this is very odd. I have tried it quite a few ways, but I can never target the form. Any other ideas? It is frustrating because I really need to target a form in the html response... On Apr 13, 11:45 am, James wrote: > That's strange. I can't get it to work either and I'm getting the same

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
Nope, that returns undefined as well. :( On Apr 13, 11:34 am, Nathan wrote: > You could try changing this: alert($(html).find("#test").attr > ('action')); > To This: alert($("#test").attr('action')); > > On Apr 13, 9:47 am, Nic Hubbard wrote: > > > Test page to show the problem:http://www.puc.e

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Jack Killpatrick
Maybe try: success: function(html){ alert($(html).find('form').attr('action')); I had some issues in the past using form id's with the jquery form plugin, but usually getting it using 'form' worked. That said, since the response isn't in the DOM yet, I'm not sure if that might present an is

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread James
That's strange. I can't get it to work either and I'm getting the same results as you (I can get #test2, but not #test). I've even truncated the response down to as if you're only receiving the part and it still doesn't work. I'd be interested in seeing what happens here too. On Apr 13, 6:47 am

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nathan
You could try changing this: alert($(html).find("#test").attr ('action')); To This: alert($("#test").attr('action')); On Apr 13, 9:47 am, Nic Hubbard wrote: > Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test > > On Apr 13, 9:33 am, Nic Hubbard wrote: > > > > > I am pulling

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan
If I understand correctly what you are tring to do, I think what you are looking for is the live() event http://docs.jquery.com/Events/live On Apr 13, 5:47 pm, Nic Hubbard wrote: > Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test > > On Apr 13, 9:33 am, Nic Hubbard wrote:

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
Test page to show the problem: http://www.puc.edu/dev/tests/ajax-test On Apr 13, 9:33 am, Nic Hubbard wrote: > I am pulling my hair out over this.  I swear that this is a bug. > > For some reason, I CANNOT target any forms within the html response. > I have tried very simple examples and it stil

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard
I am pulling my hair out over this. I swear that this is a bug. For some reason, I CANNOT target any forms within the html response. I have tried very simple examples and it still won't work. Here is what I have, that still returns undefined: HTML: http://test.com";> this is my text jQuery: