LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-12-2013, 05:06 AM   #1
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Post including external code in JS


Hi Gang!

Okay, I ventured into the OOP side of JS and find it very "familiar"...nice...
Now, I made a file called Node.js, a single node in a tree, I'd like to create this three in an other file called Tree.js. Of course, I need nodes in that tree. How do I include Node.js in Tree.js?
In HTML it's

Quote:
<script scr="Node.js"></script>
But I doubt that would be the case here...

Lemme know is a smidgin of code is needed...

Thanks!

Thor

Last edited by ButterflyMelissa; 09-12-2013 at 05:10 AM.
 
Old 09-13-2013, 03:22 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
What's the content of Node.js? Of course you have to load it with an html tag.

You may find an interesting approach to javascript OOP-style here:
http://mootools.net
It's my favourite framework in js. I prefer it even to jQUery which is more popular. It has a class function which enables you to use, re-use and extend class like functions in js.
Cheers, j

Last edited by j-ray; 09-13-2013 at 03:24 AM.
 
1 members found this post helpful.
Old 09-14-2013, 11:19 AM   #3
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766

Original Poster
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Of course you have to load it with an html tag.
I just tried that and that's the solution. Where was my brain...oh, there it is, next to the coffee...

Thanks, that was the clue. Be looking at mootools too, used that for a site wayway back and it looked great, never got to DL it...now's my chance...
It's my very first attempt at OOP in JS and it seems I've got some stuff yet to learn...
Thor

Last edited by ButterflyMelissa; 09-14-2013 at 11:29 AM.
 
  


Reply

Tags
external scripts, javascript, oop



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Including basic linux OS code as a library package into a CCSv5 project for TCI6636 ? cmtht Linux - Embedded & Single-board computer 2 06-06-2013 12:27 AM
Including lzo compressor library in linux source code. paragdas31s Linux - General 3 04-12-2010 03:29 PM
compile cpp code including iostream ufmale Programming 1 09-13-2008 01:30 AM
Including the header file of a module in kernel code omkarlagu Linux - Newbie 0 02-05-2006 07:55 AM
c++ programming: including headers from external libraries isl01jbe Programming 3 07-20-2004 08:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration