Attention:

Support Rules and Guidelines
Before you post your support topic, please remember to:
  • Read the support forum rules.
  • Check the wiki and use search to see if your problem can be answered there first.
  • Link your board please, and make sure that the problem on your board is visible to guests or provide a test account.
  • Do not post Board Wrappers and CSS unless requested. With a board link, this is not necessary.
  • Be as descriptive as you can and use as many details as possible when describing your problem.
  • Please briefly mark any links to forums that may not be work-safe.
This will help ensure your support issue will be attended to in a quick and efficient manner.

  Add ReplyNew TopicNew Poll

 External Javascript?
#
Hi everyone! Had a random thought today and wondered if anyone had tried this.

So, I'm really interested in slimming down the amount of code in my board wrappers if possible so my non-coder co-admin may be able to come in and post updates when I'm not able to. I've done a majority of the work by offloading most things into webpages and just using the keys in the board wrappers.

But, when it comes to javascript I've noticed that some things I use (font awesome, for example) I use the link they provide to a javascript file. Is there a way to condense the other javascript in my wrappers to do this as well? I'm mostly concerned with the scripts that contain the JCINK-specific variables, like <!-- |input_display| -->.

I do know how to create and host the javascript files, just FYI. Thanks in advance!
PM
#
You can copy/paste your scripts into notepad and then save them as .js files. If you upload them to your site using jcink's file manager you can then insert the link into your board wrappers.

I haven't tried using Jcink-specific variables in script files actually. Would be cool if that worked.

This post has been edited by kjrod98: Feb 13 2018, 09:32 PM
PM
#
QUOTE (kjrod98 @ Feb 13 2018, 09:30 PM)
You can copy/paste your scripts into notepad and then save them as .js files. If you upload them to your site using jcink's file manager you can then insert the link into your board wrappers.


Yep, I know how to do that already! I asked here because I'm specifically interested in how the JCINK variables will operate with them. http://files.b1.jcink.com/html/emoticons/smile.gif
PM
#
Since wrapper variables cannot be used in hosted files, here is the best practice for this.

Where you might use:

if('<!-- |input_display| -->' == 'something')

change that to

if(input_display == 'something')

and define it in wrappers:

<script>
var input_display = '<!-- |input_display| -->';
</script>

Basically just define your JFH variables as JS ones and reference those in the javascript files.

signature
email: admin@jcink.com :: blog: John C.
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | General Support | Next Newest »

Options Add ReplyNew TopicNew Poll