473,385 Members | 1,359 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,385 software developers and data experts.

External .JS file



I have a simple program to test using an external .js file.
This external file contains some functions that I need to call from several html programs.
The program as written below works fine.
1. <html>
2. <head>
3. <meta http-equiv="Content-Language" content="en-us">
4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
5. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
6. <meta name="ProgId" content="FrontPage.Editor.Document">
7. <title>External .JS file Test</title>
8. </head>
9. <body>
10. <p>Program running</p
11. <SCRIPT LANGUAGE="JAVASCRIPT" type="text/javascript"
12. document.write("Hello")
13. </SCRIPT>
14. </body>
15. </html>

When I change line number 11 to refer to an external .js file (see code below) then the program fails.

<SCRIPT LANGUAGE="JAVASCRIPT" type="text/javascript" "src=myfunctions.js"

I also tried using the full path to the .js file, no help.
The external .js file contains some functions that will be called from several html programs. Any idea what is wrong with this code?


Thanks





Thanks
Jun 19 '07 #1
3 1803
Rik
On Tue, 19 Jun 2007 19:40:00 +0200, RICHARD BROMBERG <no*****@att.net
wrote:
"src=myfunctions.js"
Now, what seems wrong, and could a simple HTML validator tell you?
--
Rik Wasmus
Jun 19 '07 #2
On Jun 19, 8:01 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 19:40:00 +0200, RICHARD BROMBERG <nore...@att.net>
wrote:
"src=myfunctions.js"

Now, what seems wrong, and could a simple HTML validator tell you?
--
Rik Wasmus
OK, let's help the man instead of being sarcastic:
error #1: you need to say argument="value", not "argument=value" - so,
we need <script ... src="myfunctions.js">
error #2: you didn't close the <scripttag - so you need to have it
like (and summarizing here):
<script language="javascript" type="text/javascript"
src="myfunctions.js"></script>

Jun 19 '07 #3
Darko said the following on 6/19/2007 2:19 PM:
On Jun 19, 8:01 pm, Rik <luiheidsgoe...@hotmail.comwrote:
>On Tue, 19 Jun 2007 19:40:00 +0200, RICHARD BROMBERG <nore...@att.net>
wrote:
>>"src=myfunctions.js"
Now, what seems wrong, and could a simple HTML validator tell you?
--
Rik Wasmus

OK, let's help the man instead of being sarcastic:
error #1: you need to say argument="value", not "argument=value" - so,
we need <script ... src="myfunctions.js">
error #2: you didn't close the <scripttag - so you need to have it
like (and summarizing here):
<script language="javascript" type="text/javascript"
src="myfunctions.js"></script>
Error #3: The validator will tell you that the language attribute is
deprecated. It can also, in some circumstances, cause unwanted side
effects - especially if given javascript1.2 as the language.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 19 '07 #4

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

Similar topics

6
by: Christopher Benson-Manica | last post by:
Just FMI, if an external stylesheet is linked to a page (with <link>), will subsequent <style> tags override the values in the external stylesheet? -- Christopher Benson-Manica | I *should*...
8
by: Scott Allen | last post by:
Hello, I'm new to C++ development and I'm trying out figure out the cause of an 'unresolved external symbol' error that I'm receiving when compiling. Here is some history on what I'm doing: I...
1
by: Aravind | last post by:
we have two files: 1. rc4.c (defines one function "create_pin()") 2. MyImpl.c(calling the function "create_pin()"),This implements JNI method. 1.When I am trying to create .dll file with one...
4
by: Peter Ammon | last post by:
I would like to share a variable between two functions defined in two separate source files; no other functions will need the global variable so I'd prefer to not give it file scope. Thus, I want...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
1
by: Brian Kendig | last post by:
I've got some questions about using an external javascript file, included via '<script type="text/javascript" src="mycode.js" ></ script>': (1) If I define a function "myFunction()" in the...
2
by: murthydb2 | last post by:
Hi My requirement is that i have to write a stored procedure in db2 and that will be executed in a batch file . Any system error or validation error that occurs inside the db2 sp during...
0
debasisdas
by: debasisdas | last post by:
This thread contains some useful tips for using External tables. USING EXTERNAL TABLE ======================= 1.THE TABLE POINTS TO EXTERNAL FILE. IF DATA IS ALTERED IN THE EXTERNAL FILE,DATA...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.