Jump to content
UBot Underground

Variables inside javascript code on UI Text Block


Recommended Posts

Hey guys,

 

So I'm trying to basically run a bot where I can whip up a quick jquery code to make my code super adaptable by offering the capability of having the jquery code be loaded up at runtime - with a ui block text...

 

But one thing I can't figure out right now is how to:

 

1- put ubot variables into that text and

2- have ubot evaluate that code before actually running the javascript

 

So that when the javascript code runs it can actually pick up values from ubot variables.

 

Thanks to whoever can help out, I've been trying to crack this nut for a bit and maybe some of you have already figured it out - or it's really simple and I've just had too much caffeine :)

 

Thanks once again,

Bob

Link to post
Share on other sites

Here's basically what I have so far:

 

I'm running the bot to load jQuery then

I'm running a javascript with the contents 

of the #jscode variable (which is set on the UI)

 

Here's the code I want to run:

 

jQuery('body').append('{#name}');

 

Right now, it appends {#name} to the body but I want it to

append the contents of the #name variable.  Is there a command

to do this?

 

Thanks,

Bob

Link to post
Share on other sites

You can't read UBot variable directly from HTML, you need to use a hidden field that uses the variable, then you read the actual value via JQuery.val().

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...