The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Javascript Pages Question

4 posters

Go down

Solved Javascript Pages Question

Post by Eden Alexandria 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
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 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
Russel
Active Poster

Male Posts : 1407
Reputation : 236
Language : English, Filipino
Location : Philippines

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria 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
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 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.


Javascript Pages Question Slgray10

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

Male Posts : 51568
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria 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
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 August 9th 2015, 4:38 pm

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

Do you mean creating a HTML page?


Javascript Pages Question Slgray10

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

Male Posts : 51568
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria 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
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 August 9th 2015, 7:18 pm

What specifically are you trying to do?


Javascript Pages Question Slgray10

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

Male Posts : 51568
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Eden Alexandria 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
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 August 9th 2015, 7:22 pm

It depends on what each code effects and do.


Javascript Pages Question Slgray10

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

Male Posts : 51568
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Javascript Pages Question

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript Pages Question

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

Ah, I see. That makes sense. Thank you, SLGray and Ange!  :rose: :rose:
Eden Alexandria
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 August 9th 2015, 9:14 pm

Topic solved and archived


Javascript Pages Question Slgray10

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

Male Posts : 51568
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top


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