• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

basic help with Jquery + AJAX

 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,

if have following code and question after line 6,7 and 16.

would Appreciate quick response



[ May 30, 2008: Message edited by: Praful Thakare ]
[ May 30, 2008: Message edited by: Praful Thakare ]
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as 6 & 7 you should really be using the .load() function if you are just plopping in a bit of HTML returned from the server.



http://docs.jquery.com/Ajax/load

With regards to 16, huh? What are you trying to achieve?
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a ton Gregg , yep i tried load and its working for safari only, but may be something wrong with with my html.

well with 16 i just want to know content of the selector (in this case div)

-P
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was kinda hard to figure out what you were doing because the indentation in your code is rather boofed up....

But, I wouldn't approach the problem in the way that you are doing.

Firstly, you shouldn't use ajaxSuccess to do something this specific. The "global" ajax callback handlers are for setting up general things to do for all Ajax calls on a page. When using $.get() and wanting to handle its response, I'd pass the callback to $.get() and keep things tidy and focused rather than spreading things out all over the place. When passing the callback, the response data is passed as the first param to the callback.

Secondly, I wouldn't be using $.get() here at all. It looks like you are wanting to load the response into a target element. For that, the load() wrapper method is the preferred and easiest route.


[Edit: we all bonked heads!}
[ May 30, 2008: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg and Bear .. Thanks much for you help, I will do more rnd on load and get it done.

Have Great Weekend

Cheers !!!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic