473,395 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help moving scripts Into Separate File

JCO
Can somebody help me move scripts into a separate file (ie JavaScript) so
that I can simply call the script from the body... and have it execute.
I've done simple (couple to several lines) ones before but I can't get this
one to work. I posted the url on a free site. Ignore the advertising and
popups. The url is www.angelfire.com/falcon/jcotest

I created the folder and the name of the JavaScript file already. When you
go the site, it simply gives you the option to select one item and the html
will display the "translucent scroller" that I want to put into a
JavaScript. I hope this can be done.

Thanks in advance.
Jul 20 '05 #1
4 3662

JCO wrote:
Can somebody help me move scripts into a separate file (ie JavaScript) so
that I can simply call the script from the body...


1. copy everything in the transparent scroller javascript script from
this page:

http://www.angelfire.com/falcon/jcot...tScroller.html

into a file named "scroller.js" (or whatever you want to call it, ending
with the '.js' extension). Do not include the <script> or </script>
lines in the .js file, include everything between them. The first line
in scroller.js will be:

//Translucent scroller- By Dynamic Drive

the last line will be:

window.onload=startit

2. insert this line into your html where you want the scroller to appear:

<script type="text/javascript" src="scroller.js"></script>

If scroller.js is not in the same folder as the html page that
references it with the above line, you'll have to provide the path in
'src='.

Does that work?

Mike

Jul 20 '05 #2
JCO
Okay, I've done this but I'm having a weird effect.

First of all, instead of an onload, can't I just place this in the body
<script> startit() </script>

When I tried this, the display was unpredictable. Then I took this out and
everything works okay.
It works okay with out having the OnLoad. Why is this. What else could be
triggering this?
"mscir" <ms***@access4less.net> wrote in message
news:10*************@corp.supernews.com...

JCO wrote:
Can somebody help me move scripts into a separate file (ie JavaScript) so that I can simply call the script from the body...
1. copy everything in the transparent scroller javascript script from
this page:

http://www.angelfire.com/falcon/jcot...tScroller.html
into a file named "scroller.js" (or whatever you want to call it, ending
with the '.js' extension). Do not include the <script> or </script>
lines in the .js file, include everything between them. The first line
in scroller.js will be:

//Translucent scroller- By Dynamic Drive

the last line will be:

window.onload=startit

2. insert this line into your html where you want the scroller to appear:

<script type="text/javascript" src="scroller.js"></script>

If scroller.js is not in the same folder as the html page that
references it with the above line, you'll have to provide the path in
'src='.

Does that work?

Mike

Jul 20 '05 #3
JCO wrote:
Okay, I've done this but I'm having a weird effect.
First of all, instead of an onload, can't I just place this in the body
<script> startit() </script>
When I tried this, the display was unpredictable. Then I took this out and
everything works okay.
It works okay with out having the OnLoad. Why is this. What else could be
triggering this?


1. don't top post, it messes up the q/a order of the post.

2. see ans. #2 below, add the script refernce where you want that script
embedded into your html page. There's no need to call anything in the
body onload event in this case. The javascript from the .js file is
inserted into your page where the reference to it is placed - the code
runs the same as if you had placed the contents of the .js file in that
location.
2. insert this line into your html where you want the scroller to appear:
<script type="text/javascript" src="scroller.js"></script>

Jul 20 '05 #4
JCO
What do you mean by "don't top post"?

I was under the impression that
<SCRIPT LANGUAGE="JavaScript1.2"
src="../MyScripts/TranslucentScroller.js"></SCRIPT>
simply loads the script in memory so that all functions within the script
can be invoked... when required.

I was under the impression that it can be invoked either by
<script> startit() </script>
or
onload = ?

In general, is this a true assumption?
"mscir" <ms***@access4less.net> wrote in message
news:10*************@corp.supernews.com...
JCO wrote:
Okay, I've done this but I'm having a weird effect.
First of all, instead of an onload, can't I just place this in the body
<script> startit() </script>
When I tried this, the display was unpredictable. Then I took this out and
everything works okay.
It works okay with out having the OnLoad. Why is this. What else could be triggering this?


1. don't top post, it messes up the q/a order of the post.

2. see ans. #2 below, add the script refernce where you want that script
embedded into your html page. There's no need to call anything in the
body onload event in this case. The javascript from the .js file is
inserted into your page where the reference to it is placed - the code
runs the same as if you had placed the contents of the .js file in that
location.
2. insert this line into your html where you want the scroller to appear:<script type="text/javascript" src="scroller.js"></script>


Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mcp6453 | last post by:
I am trying to use Jack's FormMail script (http://www.dtheatre.com/scripts/formmail). Since I'm brand new at PHP and not very good at HTML, I have an easy question, which I will narrow down. When...
2
by: JackFrost | last post by:
Hi all, I recently read an article on the Windows Scripting Host Object Model (WSHOM) in a back issue of Visual Studios Journal from 2000. As it gives me a useful and easy way to access all of...
0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
0
by: Jose Vicente Nunez Z | last post by:
Greetings, I wrote a couple of custom dummy extensions in Python (one a pure Python and the other a C) and i managed to compile and install them without a problem: $ make python2 setup.py...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
2
by: psuaudi | last post by:
I have a main query that I would like to call two different subqueries. In MS Access, I usually just save the two subqueries as separate queries which are then called by a third separate and main...
12
by: adamurbas | last post by:
ya so im pretty much a newb to this whole python thing... its pretty cool but i just started today and im already having trouble. i started to use a tutorial that i found somewhere and i followed...
14
by: Bennett Haselton | last post by:
I'm moving a bunch of PHP scripts from a server where they ran on PHP4, to a new server with PHP5. On the old server, variables in the query string would be automatically instantiated in the...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.