| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| How do I host Javascript codes? | |
|---|---|
| Topic Started: Nov 22 2007, 11:26 PM (3,653 Views) | |
| Dennis | Nov 22 2007, 11:26 PM Post #1 |
|
Future Dennis does not necessarily condone the contents of this message.
|
A common complaint of board owners is the 20,000 character limit in the InvisionFree board wrappers. One reason that users reach or exceed that limit is large codes which are embedded directly into the board. This is undesirable for many reasons, such as making the wrappers difficult to navigate, making it impossible for the code owner to manage the code, and increasing the possibility that part of the code will be accidentally omitted. A simple solution for code creators is to simply host the code yourself, and allow board owners to reference it from their wrappers. This guide will explain in depth how to accomplish this. The first step is to put the code in the correct format. All user-defined variables should be at the top of the code, like this:
There should never be any need to place user-defined variables in the script body. For ease of use, place all user-defined variables at the top of the code. Next, the code file needs to be created. Open up notepad, or a similar text editor, and paste all of the javascript below the "// DO NOT EDIT ... " line mentioned above. Make sure there is only javascript in the file. Remove all HTML tags and CSS code. Pay special attention to the </script> tag at the end of the code. Once the file has been correctly converted to a text file, save it with the extension ".js", or ".ibf" if you are planning on hosting it on your board. To host the code, you first need to find a host which will allow Javascript uploads. While any host will work, we recommend simply hosting it on your board. If you choose to use your own host, keep in mind that most hosts impose a limit of bandwidth, and if the code is popular, this could be a severe hindrance. If uploading to your InvisionFree forum, make sure that the code ends with the ".ibf" file extension. Attach the code to a post. Next, go to the ACP's File Manager. Click the link to View Attachments, then right click the code and choose Copy Link Location. If uploading to your ZetaBoards forum, rename the file with the extension of your choice. .zb or .ibf are good choices. Create a new Topic, then select the file to upload from the File Select Box. Once the file has been posted, Right Click and choose Copy Link Location. Open a new notepad document, and create the code following the following template:
Replace the User Defined Variables content with the variables described earlier. That's all there is to it. The code with the variables and a reference to the javascript is all that is needed in the code topic. Users can copy this simple snippet into their wrappers to use the code without worrying about large wrapper size. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · FAQ · Next Topic » |






10:27 PM Nov 23