Jump to content
UBot Underground

Calling Js And Css With 'on Load' Function


Recommended Posts

Hi,

 

I found a thread on how to call my 'js' and 'css' for the Ui html panel

I use in my bot. I've downloaded the examples and altered the code

to fit.

 

However it doesn't seem to work and I can't figure out why. Probably

something simple I've missed again.

 

I put the following at the top of my bot:

 

on load("Bot Loaded") {
    set(#Javascript"my script is in here""Global")
    set(#CSS"my script is in here""Global")

 

And this in my UI HTML Panel:

 

ui html panel("<html>
<head>
<title></title>
<script type=\'text/javascript\' charset=\'utf-8\'>
{#Javascript}
</script>
<style type=\"text/css\">
{#CSS}
</style>
</head>

 

What have I done wrong?

 

Thanks,

Andy

Link to post
Share on other sites

Since the ui html panel runs on bot load then you can just put your css there - you don't need to add it in to the bot loaded node. I have also added in the jquery library in there before so I'm sure you can put javascript in there as well. Can you provide an example script?

Link to post
Share on other sites

Hi Hellolnsomnia,

 

Yeah, I originally had it all within the UI HTML Window, but the

interface for the bot is very sluggish and unresponsive after

a few minutes. So I decided to find another way.

 

The example script I used was from this thread:

http://www.ubotstudio.com/forum/index.php?/topic/10252-how-to-include-css-and-js-files-in-ui-html-box/?pid=52891&do=findComment&comment=52891

 

This works great.

 

Thanks,

Andy

Link to post
Share on other sites

DOH!!!

 

When I compiled it the darn thing worked :)

 

Had me stumped because the example script I showed

you actually worked when I loaded it into Ubot, but mine

didn't. So I figured I'd done something wrong.

 

Sorry for wasting your time mate.

 

Thanks,

Andy

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...