473,670 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Micros oft FrontPage 4.0">
6. <meta name="ProgId" content="FrontP age.Editor.Docu ment">
7. <title>Extern al .JS file Test</title>
8. </head>
9. <body>
10. <p>Program running</p
11. <SCRIPT LANGUAGE="JAVAS CRIPT" 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="JAVAS CRIPT" type="text/javascript" "src=myfunction s.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 1841
Rik
On Tue, 19 Jun 2007 19:40:00 +0200, RICHARD BROMBERG <no*****@att.ne t
wrote:
"src=myfunction s.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.comwro te:
On Tue, 19 Jun 2007 19:40:00 +0200, RICHARD BROMBERG <nore...@att.ne t>
wrote:
"src=myfunction s.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="myfunction s.js">
error #2: you didn't close the <scripttag - so you need to have it
like (and summarizing here):
<script language="javas cript" type="text/javascript"
src="myfunction s.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.comwro te:
>On Tue, 19 Jun 2007 19:40:00 +0200, RICHARD BROMBERG <nore...@att.ne t>
wrote:
>>"src=myfuncti ons.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="myfunction s.js">
error #2: you didn't close the <scripttag - so you need to have it
like (and summarizing here):
<script language="javas cript" type="text/javascript"
src="myfunction s.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.javas cript 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
3419
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* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
8
4159
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 have an existing VC++ project that mostly just reads a SQL Server database does some work on the data and insert the results into another table. I have the need to incorproate some functionality from a certain dll named cedb300.dll. cedb300.dll...
1
8403
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 file rc4.obj(rc4.c),it is creating the .dll file without any error. Command : ILINK32 rc4.obj 2.But,when we are trying to create .dll file with two .obj files with following errors.
4
2734
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 a variable with local scope, external linkage, and static storage. I believe I can do this for the file that does not define the variable by declaring it inside a function. Can I also avoid giving it file scope in the file that does define the...
5
3624
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 New System.Diagnostics.Process 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut) p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE") 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
2
5319
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>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on python-list@python.org . - Josiah
1
3316
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 original HTML file, and reference it by "onMouseDown='myFunction();'" in a tag, it works. But if I move the myFunction() definition to an external javascript file, Firefox tells me "myFunction is not defined". Why is this, and how can I be able to...
2
6129
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 the execution need to be written in external flat file ( Log file to know the error ) . Is there anything similar in db2 like UTL_FILE in oracle . Please find the sample coding in oracle which will write the output to a external flat...
0
8842
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 IN THE TABLE WILL ALSO CHANGE. 2.EXTERNAL TABLES CAN BE QUERIED IN THE SAME WAY AS STANDARD TABLES IN JOINS,VIEWS.....AND CAN USE ALL TYPES OF FUNCTION ON THE EXTERNAL TABLE. 3.TO GET INFO REGARDING EXTERNAL TABLES QUERY THE "USER_EXTERNAL_TABLES"...
0
8388
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8593
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8663
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5687
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2804
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1799
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.