Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 03 Sep 2012, 15:44
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Question Userid fetch and pass?

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
Reply With Quote
  #2  
Old 03 Sep 2012, 15:51
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
If this is in the postbit, you could try {vb:raw post.userid}.
Reply With Quote
  #3  
Old 03 Sep 2012, 16:02
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by kh99 View Post
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

Last edited by BadgerDog; 03 Sep 2012 at 16:17.
Reply With Quote
  #4  
Old 03 Sep 2012, 16:03
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I'm pretty sure that's right, yes. Does it not work?
Reply With Quote
  #5  
Old 03 Sep 2012, 16:17
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
I can't seem to make it work ...

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

Thanks anyway ...

Regards,
Doug
Reply With Quote
  #6  
Old 03 Sep 2012, 16:21
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 13:42.

Layout Options | Width: Wide Color: