PDA

View Full Version : Userid fetch and pass?


BadgerDog
09-03-2012, 02:44 PM
I'm trying to get a piece of code to fetch the userid of the poster in any given thread and pass it to a javascript..

Here's the code

<a href="javascript:void(0)" onclick="javascript:jqcc.mychat.chatWith('1');">Chat with me</a>

Instead of the absolute "1", what would be the variable name I substitute in order to have "1" replaced with the userid of the poster?

Thanks for any help .. :)

Regards,
Doug

kh99
09-03-2012, 02:51 PM
If this is in the postbit, you could try {vb:raw post.userid}.

BadgerDog
09-03-2012, 03:02 PM
If this is in the postbit, you could try {vb:raw post.userid}.

So, this would be the correct code?

<a href="javascript:void(0)" onclick="javascript:jqcc.mychat.chatWith('{vb:raw post.userid}');">Chat with me</a>

Thanks?

Regards,
Doug

kh99
09-03-2012, 03:03 PM
I'm pretty sure that's right, yes. Does it not work?

BadgerDog
09-03-2012, 03:17 PM
I can't seem to make it work ...

..but, I'm not a programmer, so it's probably me .. :D

Thanks anyway ...

Regards,
Doug

kh99
09-03-2012, 03:21 PM
Well, I'm never 100% sure the code is right unless I try it. What happens when you try it? Have you tried viewing the html source of your page and seeing what that code looks like?