Javascript Pages Question
4 posters
Page 1 of 1
Javascript Pages Question
When adding a jQuery page, what would I introduce it with, within a post? Just <script> tags? Or would I have to place the entire page into a Javascript page in the Admin Panel?
Last edited by Eden Alexandria on August 9th 2015, 7:52 pm; edited 2 times in total
Re: Javascript Pages Question
Hi @Eden Alexandria,
JS codes don't work within a post. We use the Javascipt page in the Admin Panel.
JS codes don't work within a post. We use the Javascipt page in the Admin Panel.
Russel- Active Poster
- Posts : 1407
Reputation : 236
Language : English, Filipino
Location : Philippines
Re: Javascript Pages Question
Alright. Now, would each JS page have to be separate? Or could you have several functions within one page?
Re: Javascript Pages Question
What do you mean by page?
Please change the title of your topic to something that is related to your question/issue, so that other users will be able to find their question/issue using the search engine.
Please change the title of your topic to something that is related to your question/issue, so that other users will be able to find their question/issue using the search engine.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Pages Question
Changed the title. What I mean by page is the javascript management section of the Admin Panel. You of course click on the green button to add a "page" of JS or jQuery. Though you know that already haha xD
Re: Javascript Pages Question
It is not called a page, but a JavaScript code.
Do you mean creating a HTML page?
Do you mean creating a HTML page?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Pages Question
Nono I meant Javascript. I was just using improper terminology xD But yes, a javascript code is what I am referring to.
Re: Javascript Pages Question
What specifically are you trying to do?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Pages Question
I'm more or less wondering if I can put more than one "function" into a single code, or if I have to make a different code for each function.
Re: Javascript Pages Question
It depends on what each code effects and do.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Javascript Pages Question
You can place as many functions as you want in a script. Everything usually gets combined into one file if the placement is "in all the pages"
Normally when writing JavaScript you'll want to execute it AFTER the desired HTML element is loaded ( or ready ). The JS codes management page executes all code in the <HEAD> section before the document is ready, so people usually start their scripts with a jQuery DOM ready function.
The basic and shortest syntax for that is :
Where the comment is, is where you'll write your code.
Depending on what you're doing, you don't always need to use the above. It's mostly meant for if you're manipulating the document. ( e.g. add a specific function to an array of elements, or hiding something )
If it's just a normal function that will be called later, then you can just add it like this in JS management.
Normally when writing JavaScript you'll want to execute it AFTER the desired HTML element is loaded ( or ready ). The JS codes management page executes all code in the <HEAD> section before the document is ready, so people usually start their scripts with a jQuery DOM ready function.
The basic and shortest syntax for that is :
- Code:
$(function() {
// everything else to execute when the DOM is ready
});
Where the comment is, is where you'll write your code.
Depending on what you're doing, you don't always need to use the above. It's mostly meant for if you're manipulating the document. ( e.g. add a specific function to an array of elements, or hiding something )
If it's just a normal function that will be called later, then you can just add it like this in JS management.
- Code:
function callMe() {
alert('You called me ?');
};
Re: Javascript Pages Question
Topic solved and archived
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum