|
|
Forum moderator: bigblog |
uCoz Community For Webmasters Custom Solutions where do you save javascript code? |
where do you save javascript code? |
Where do you save javascript code files? And how to make them accessible from html files?
Reason: I need to add tabs for text so people can choose between two texts conveing the same message in two languages http://www.w3schools.com/howto/howto_js_tabs.asp Post edited by terminasyanarmen - Friday, 2016-05-06, 7:48 PM
|
terminasyanarmen, you can upload the JavaScript files through the File Manager (Control Panel » File Manager). After that, you only need to implement the file in the page, before the </body> tag:
Code <script type="text/javascript" src="/path/file.js"></script> hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau sometimes i lurk here |
Thanks, this works perfectly. Only one issue. Unless I click one of the tab, there is no "default tab", no text is shown until one of the tabs is clicked, only the tabs are shown. How to make the first tab content shown even before any tab is clicked?
used the exact CSS and JS codes as in here: http://www.w3schools.com/howto/howto_js_tabs.asp JS script uploaded and linked to in the html code as you explained. Post edited by terminasyanarmen - Saturday, 2016-05-07, 11:55 PM
|
There you go: http://makegamesfast.at.ua/#
Before you click any tab no text is shown. Added (2016-05-11, 4:11 PM) |
terminasyanarmen, try to add
Code openCity("London") and a line break to the beginning of the JavaScript code. hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau sometimes i lurk here |
Didn't do anything I'm afraid.
|
try to add I- "active" to class="tablinks" <li><a href="#" class="tablinks active" onclick="openTab(event, 'London')">London</a></li> II- style="display:block" to class="tabcontent" <div id="London" class="tabcontent" style="display:block"> <?if(you_have)?> a <head>and<?if(you_have)?> a <body> you have to have
<div id="idea" class="extreme" > to be inventive </div><?endif?><?endif?> |
That sadly didnt change anything either
|
I understand what that is meant to do, but emulating a tab click doesn't seem to work as well...
EDIT: Sorry, it does work Thank you. It didn't work because I put the code inside the function definition. Post edited by terminasyanarmen - Thursday, 2016-05-12, 0:30 AM
|
| |||
| |||