The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Ajax script seems not to work anymore

View previous topic View next topic Go down

Solved Ajax script seems not to work anymore

Post by Mati on Tue Nov 11, 2014 11:21 am

I use this ajax script to count the new PM's but it seems not working anymore I have a custom navbar, was working fine one PunBB before I switched to phpBB3.

Code:
$.ajax({
 url: '/privmsg?folder=inbox',
 success: function(ajax) {
  count = $('img[src="http://i78.servimg.com/u/f78/14/73/12/96/bf_new10.png"]', ajax).length;
 
  if (count < 1) {
  $('a.mailbox').html('<span>Mailbox</span>');
  }

  else {
  $('a.mailbox').html('<span>Mailbox ('+count+')</span>');
  }
 }
});

Any idea on how to fix this...


Last edited by Mati™ on Wed Nov 12, 2014 12:22 am; edited 1 time in total
avatar
Mati
Active Poster

Posts : 1897
Reputation : 283
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://forumdirectory.forumotion.net/

Back to top Go down

Solved Re: Ajax script seems not to work anymore

Post by Ange Tuteur on Tue Nov 11, 2014 5:28 pm

Hello Mati,

Are you using this image for new messages ?
http://i78.servimg.com/u/f78/14/73/12/96/bf_new10.png
avatar
Ange Tuteur
Forumaster

Male Posts : 13068
Reputation : 2742
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax script seems not to work anymore

Post by Mati on Tue Nov 11, 2014 5:30 pm

Yeah that's the "Subject - New" icon from the Icons for topics.
avatar
Mati
Active Poster

Posts : 1897
Reputation : 283
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://forumdirectory.forumotion.net/

Back to top Go down

Solved Re: Ajax script seems not to work anymore

Post by Ange Tuteur on Tue Nov 11, 2014 5:35 pm

Try this :
Code:
$.ajax({
 url: '/privmsg?folder=inbox',
 success: function(ajax) {
  count = $('dl[style*="http://i78.servimg.com/u/f78/14/73/12/96/bf_new10.png"]', ajax).length;
 
  if (count < 1) {
  $('a.mailbox').html('<span>Mailbox</span>');
  }

  else {
  $('a.mailbox').html('<span>Mailbox ('+count+')</span>');
  }
 }
});
avatar
Ange Tuteur
Forumaster

Male Posts : 13068
Reputation : 2742
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax script seems not to work anymore

Post by Mati on Wed Nov 12, 2014 12:21 am

Perfect thanks a lot Ange! Very Happy
avatar
Mati
Active Poster

Posts : 1897
Reputation : 283
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://forumdirectory.forumotion.net/

Back to top Go down

Solved Re: Ajax script seems not to work anymore

Post by Ange Tuteur on Wed Nov 12, 2014 1:19 am

You're welcome Very Happy

Topic archived
avatar
Ange Tuteur
Forumaster

Male Posts : 13068
Reputation : 2742
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum