Ajaxify javascript [solved]

  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

In case anyone doesn't know about it - Ajaxify is a wonderful little jQuery plugin.

I'm wondering if it would be possible to use it to refresh a div on a timer - for a chat app.

Any ideas?
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

I didn't play with it too long, but it seems like a bit of an over-played plugin to me. Part of jQuery's core functionality allows the same behavior in a few lines of code.

Refresh a div on a timer? Combine your $.ajax() call with a setTimeout() within the success callback.
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

It's for a chat application - I'd like to poll a php script for a non-blank result (a recent reply), and append the content to the div. You can see an example here. (Click on the Chat Test button)

All I need to be able to do is do the same thing as the plugin does, just called by javascript (page load or timer etc) rather than clicking on a link.

Could I use event=false ? (Edit: I'm trying this now, I think it's the way to go)
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

My apologies, I didn't fully understand the specifications. Thanks for your help :)

To load a php script in an html document using javascript, do something like the following:

$('#divname').ajaxify({
target:'#targetdiv',
link:'http://example.com/script.php',
event:false
});

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 134 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.