The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Javascript Pages Question

View previous topic View next topic Go down

Solved Javascript Pages Question

Post by Eden Alexandria on August 8th 2015, 3:25 am

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

Eden Alexandria
Forumember

Female Posts : 36
Reputation : 1
Language : English

http://www.narutolegacy.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Russel on August 8th 2015, 4:35 am

Hi @Eden Alexandria,

JS codes don't work within a post. We use the Javascipt page in the Admin Panel.

Russel
Active Poster

Male Posts : 1400
Reputation : 235
Language : English, Filipino
Location : Philippines

http://help.forumotion.com/forum

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria on August 8th 2015, 10:13 pm

Alright. Now, would each JS page have to be separate? Or could you have several functions within one page?

Eden Alexandria
Forumember

Female Posts : 36
Reputation : 1
Language : English

http://www.narutolegacy.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by SLGray on August 8th 2015, 10:16 pm

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.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35631
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria on August 9th 2015, 12:48 am

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

Eden Alexandria
Forumember

Female Posts : 36
Reputation : 1
Language : English

http://www.narutolegacy.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by SLGray on August 9th 2015, 4:38 pm

It is not called a page, but a JavaScript code.

Do you mean creating a HTML page?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35631
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria on August 9th 2015, 5:55 pm

Nono I meant Javascript. I was just using improper terminology xD But yes, a javascript code is what I am referring to.

Eden Alexandria
Forumember

Female Posts : 36
Reputation : 1
Language : English

http://www.narutolegacy.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by SLGray on August 9th 2015, 7:18 pm

What specifically are you trying to do?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35631
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria on August 9th 2015, 7:21 pm

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.

Eden Alexandria
Forumember

Female Posts : 36
Reputation : 1
Language : English

http://www.narutolegacy.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by SLGray on August 9th 2015, 7:22 pm

It depends on what each code effects and do.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35631
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Ange Tuteur on August 9th 2015, 7:36 pm

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 :
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 ?');
};

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria on August 9th 2015, 7:52 pm

Ah, I see. That makes sense. Thank you, SLGray and Ange! :rose: :rose:

Eden Alexandria
Forumember

Female Posts : 36
Reputation : 1
Language : English

http://www.narutolegacy.com/

Back to top Go down

Solved Re: Javascript Pages Question

Post by SLGray on August 9th 2015, 9:14 pm

Topic solved and archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35631
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum