The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
JS: Retrieve userid
Hello...
I need to get the current userid from within a js file. I cannot send the userid to the javascript as a parameter (since this particular javascript file is part of a convoluted string of js and html files). Any suggestions? TIA, D. |
#2
|
|||
|
|||
before you call the .js file I believe you can set a js variable which will be in the scope of the .js file.
ie. HTML Code:
<script language="javascript"> myvar = 6; </script> <script language="javascript" src="yourjsfile.js"></script> Not exactly sure on the syntax, but hopefully you get what I mean |
#3
|
|||
|
|||
Thanks. Either I'm in a catch-22 or my coding skills aren't up to the task. The js file that needs the userid is called by an html document which doesn't know the userid. The html is openned by yet another js which does know the userid. I haven't found a way to send the userid from the first js to the html and from there to the 2nd js file.
I'm trying to customize the PHPSpell hack by enabling/disabling the Learn button depending on userid. I've asked there, but no response yet. Of course now that I'm having trouble my manager wants the customization done asap. Funny how that works. "Oh, it's troublesome? In that case I need it even sooner and the priority just went up." Sheesh. :ermm: Thx, D. |
#4
|
||||
|
||||
to get it into the html page, I think you can fill it into a text field. And also read it from that text field. The thing is, where would you hide the textfield....
Maybe It'll help |
#5
|
|||
|
|||
yeah, if you passed a hidden field, you could do it.... but that's very insecure since someone could just send the correct headers and see the button you're hiding...
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|