Lgtestforum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Who is online?
In total there are 2 users online :: 0 Registered, 0 Hidden and 2 Guests

None

[ View the whole list ]


Most users ever online was 37 on Fri Sep 17, 2021 8:43 pm
Statistics
We have 15 registered users
The newest registered user is bilde

Our users have posted a total of 271 messages in 27 subjects
deleted after updated

visitor message notification

Go down

visitor message notification Empty visitor message notification

Post by Admin Thu Dec 22, 2011 3:11 pm

PLEASE NOTE: for this tutorial to work you must have installed this: http://www.diondesigns.org/t440-example-9-accessing-user-information-all-boards

Admin
Admin
Admin

Avacweb
Posts : 231
Points : 282
Join date : 2011-11-07

https://testlg.forumotion.co.uk

Back to top Go down

visitor message notification Empty Re: visitor message notification

Post by Admin Thu Dec 22, 2011 4:05 pm

Code:

var a=new XMLHttpRequest();
a.open("GET","/u" +uid+ "wall",true);
a.send();

a.onreadystatechange=function() {
  if (a.readyState==4 && a.status==200)  {
      var x=a.responseText.indexOf('title="New message" /> by ');
      if (x != -1) {
        var c=a.responseText.substring(x,a.responseText.indexOf('</a>',x)+4);
        var user=c.substring(26,c.length); alert(user); 
        var html="<div id='LGnewVM'>Notification: '"+user+"' has left you a Visitor Message!<br><br><span onclick=\"document.getElementById('LGnewVM').style.display='none';\">Close</span></div>";
        document.body.innerHTML+=html;
      }
  }
}
phpbb3.
Admin
Admin
Admin

Avacweb
Posts : 231
Points : 282
Join date : 2011-11-07

https://testlg.forumotion.co.uk

Back to top Go down

Back to top


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