473,386 Members | 2,129 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,386 software developers and data experts.

funtion not defined error - external JS file, onClick issues

tpgames
785 512MB
External JS file's function crossWord is not defined. I checked the link and the code. Can not find my error. I thought I might be missing something obvious like a ";" or something, but nothing I've tried works.
Thanks! :D
I copied and pasted the direct link to external JS file in to my code to be sure that wasn't the issue.

Expand|Select|Wrap|Line Numbers
  1.  <link type="text/javascript" href="http://www.globalwritersclub.com/gaming/2/word/xw/fr/1a.js"> 
  2.  
The external JS file, with only the form value's #6-91 deleted, but the rest of the code is there.
Expand|Select|Wrap|Line Numbers
  1. function crossWord(){
  2. if (document.form.c1.value=="l"
  3.     && document.form.c2.value=="a"
  4.     && document.form.c3.value=="s"
  5.     && document.form.c4.value=="n"
  6.     && document.form.c5.value=="e"
  7. )
  8.   alert("All is correct!")
  9.  
  10. else {alert("Problem. Please check answers.")}
  11. }
  12.  
The html code that calls the function.
Expand|Select|Wrap|Line Numbers
  1. <input type="button" value="Check Puzzle" onClick="javascript: crossWord()">
The abbreviated html code from the page, showing the context.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
  2. <html>
  3. <head>
  4. <LANG="UTF-8">
  5. <title> Final XW </title>
  6. <META http-equiv="expires" content="Thur, 1 March 2007 13:00:00 GMT">
  7. <META http-equiv="content-type" content="text/html";charset=utf-8">
  8. <link type="text/css" rel="stylesheet" href="/gaming/2/word/xw/xwcss/xw2.css"> 
  9. <link rel="shortcut icon" href="http://www.globalwritersclub.com/gwc.gif">
  10.  
  11. <link type="text/javascript" href="http://www.globalwritersclub.com/gaming/2/word/xw/fr/1a.js"> 
  12. </head>
  13.  
  14. <body onLoad="alert('Please use lower case only!')">
  15.  
  16. <table>
  17. <td><p class="pcenter">  &nbsp; &nbsp; &nbsp; <img src="http://www.globalwritersclub.com/gwc/img/linkbanner6.jpg" width="900px" height="4px" alt=""> </p></td></tr>
  18.  
  19. <tr>
  20. <td>
  21. <table>
  22. <form name="form">
  23.  
  24. <tr>
  25. <td class="b1r40"> &nbsp; </td>
  26. <td class="b1r80"> 1</td>
  27. <td class="b1r120"> 2 </td>
  28. <td class="b1r160"> 3 </td>
  29. <td class="b1r200"> 4</td>
  30. <td class="b1r240"> 5 </td>
  31. <td class="b1r280"> 6</td>
  32. <td class="b1r320"> 7</td>
  33. <td class="b1r360"> 8</td>
  34. <td class="b1r400"> 9</td>
  35. <td class="b1r440"> 10</td>
  36. <td class="b1r480"> 11</td>
  37. <td class="b1r520"> 12</td>
  38. <td class="b1r560"> 13</td>
  39. <td class="b1r600"> 14</td>
  40. <td class="b1r640"> 15</td>
  41. <td class="b1r680"> 16</td>
  42. <td class="b1r720"> 17</td>
  43. <td class="b1r760"> 18</td>
  44. <td class="b1r800"> 19</td>
  45.  
  46. <tr><!-- laserviette-->
  47. <td class="b2r40"> 1</td>
  48. <td class="b2r80"> </td>
  49. <td class="b2r120"> </td>
  50. <td class="b2r160"><input type="text" name="c1" size="1"> </td>
  51. <td class="b2r200"><input type="text" name="c2" size="1"> </td>
  52. <td class="b2r240"><input type="text" name="c3" size="1"> </td>
  53. <td class="b2r280"><input type="text" name="c4" size="1"> </td>
  54. <td class="b2r320"><input type="text" name="c5" size="1"> </td>
  55. <td class="b2r360"><input type="text" name="c6" size="1"> </td>
  56. <td class="b2r400"><input type="text" name="c7" size="1"> </td>
  57. <td class="b2r440"><input type="text" name="c8" size="1"> </td>
  58. <td class="b2r480"><input type="text" name="c9" size="1"> </td>
  59. <td class="b2r520"><input type="text" name="c10" size="1"> </td>
  60. <td class="b2r560"><input type="text" name="c11" size="1"> </td>
  61. <td class="b2r600"> </td>
  62. <td class="b2r640"> </td>
  63. <td class="b2r680"> </td>
  64. <td class="b2r720"> </td>
  65. <td class="b2r760"> </td>
  66. <td class="b2r800"> </td>
  67.  
  68.  
  69. <tr><!-- e -->
  70. <td class="b3r40"> 2</td>
  71. <td class="b3r80"> </td>
  72. <td class="b3r120"> </td>
  73. <td class="b3r160"><input type="text" name="c12" size="1"> </td>
  74. <td class="b3r200"> </td>
  75. <td class="b3r240"> </td>
  76. <td class="b3r280"> </td>
  77. <td class="b3r320"> </td>
  78. <td class="b3r360"> </td>
  79. <td class="b3r400"> </td>
  80. <td class="b3r440"> </td>
  81. <td class="b3r480"> </td>
  82. <td class="b3r520"> </td>
  83. <td class="b3r560"> </td>
  84. <td class="b3r600"> </td>
  85. <td class="b3r640"> </td>
  86. <td class="b3r680"> </td>
  87. <td class="b3r720"> </td>
  88. <td class="b3r760"> </td>
  89. <td class="b3r800"> </td>
  90.  
  91.  
  92. <tr><!-- s l -->
  93. <td class="b4r40"> 3</td>
  94. <td class="b4r80"> </td>
  95. <td class="b4r120"> </td>
  96. <td class="b4r160"><input type="text" name="c13" size="1"> </td>
  97. <td class="b4r200"> </td>
  98. <td class="b4r240"> </td>
  99. <td class="b4r280"> </td>
  100. <td class="b4r320"> </td>
  101. <td class="b4r360"> </td>
  102. <td class="b4r400"> </td>
  103. <td class="b4r440"> </td>
  104. <td class="b4r480"><input type="text" name="c14" size="1"> </td>
  105. <td class="b4r520"> </td>
  106. <td class="b4r560"> </td>
  107. <td class="b4r600"> </td>
  108. <td class="b4r640"> </td>
  109. <td class="b4r680"> </td>
  110. <td class="b4r720"> </td>
  111. <td class="b4r760"> </td>
  112. <td class="b4r800"> </td>
  113.  
  114.  
  115. <tr><!-- labaignoire l -->
  116. <td class="b5r40"> 4</td>
  117. <td class="b5r80"><input type="text" name="c15" size="1"> </td>
  118. <td class="b5r120"><input type="text" name="c16" size="1"> </td>
  119. <td class="b5r160"><input type="text" name="c17" size="1"> </td>
  120. <td class="b5r200"><input type="text" name="c18" size="1"> </td>
  121. <td class="b5r240"><input type="text" name="c19" size="1"> </td>
  122. <td class="b5r280"><input type="text" name="c20" size="1"> </td>
  123. <td class="b5r320"><input type="text" name="c21" size="1"> </td>
  124. <td class="b5r360"><input type="text" name="c22" size="1"> </td>
  125. <td class="b5r400"><input type="text" name="c23" size="1"> </td>
  126. <td class="b5r440"><input type="text" name="c24" size="1"> </td>
  127. <td class="b5r480"><input type="text" name="c25" size="1"> </td>
  128. <td class="b5r520"> </td>
  129. <td class="b5r560"><input type="text" name="c26" size="1"> </td>
  130. <td class="b5r600"> </td>
  131. <td class="b5r640"> </td>
  132. <td class="b5r680"> </td>
  133. <td class="b5r720"> </td>
  134. <td class="b5r760"> </td>
  135. <td class="b5r800"> </td>
  136.  
  137. </form>
  138. </table>
  139. </td>
  140.  
  141. <tr><td class="lowerhalf">
  142. <table border="2" width="96%">
  143.  
  144. <tr><td colspan="3"><p class="lhc"><img src="http://www.globalwritersclub.com/gwc/img/linkbanner6.jpg" width="100%" height="4px" alt=""></p></td></tr>
  145.  
  146. <tr><td class="lhc">
  147. <input type="button" onClick="javascript: crossWord()"  value="Check Puzzle"></td>
  148. <td class="lhc"><input type="reset" value="Reset Puzzle"></td>
  149. <td class="lhc"><a href="/gaming/2/word/xwnav.html" class="blkn"> Crossword Navigation </td></tr>
  150.  
  151. <tr><td colspan="3"><p class="lhc"><img src="http://www.globalwritersclub.com/gwc/img/linkbanner6.jpg" width="100%" height="4px" alt=""></p></td></tr>
  152.  
  153. <tr><td colspan="3" class="lhl">
  154. <a href="http://www.globalwritersclub.com/gaming/2/word/xw/rules.html"> ? </a></td></tr>
  155.  
  156.  
  157. <tr><td colspan="3"><p class="lhc"><img src="http://www.globalwritersclub.com/gwc/img/linkbanner6.jpg" width="100%" height="4px" alt=""></p></td></tr>
  158. <tr><td class="lhc"> HORIZONTAL </td>
  159.  
  160. <td><p class="lhc"><img src="http://www.globalwritersclub.com/gwc/img/bulletx.gif" width="40px" height="36px" alt=""></p></td>
  161.  
  162. <td class="lhc"> VERTICAL </td>
  163. </tr>
  164.  
  165.  
  166. <tr>
  167. <td colspan="3"><p class="lhc"><img src="http://www.globalwritersclub.com/gwc/img/linkbanner6.jpg" width="100%" height="4px" alt=""></p></td></tr>
  168.  
  169. <tr><td class="lhl"> } 1 the towel </td>
  170. <td><p class="lhc"><img src="http://www.globalwritersclub.com/gwc/img/bulletx.gif" width="40px" height="36px" alt=""></p></td>
  171. <td class="lhl"> } 1 the cushion </td>
  172. </tr>
  173.  
  174. <tr><td class="lhl"> } 4 the bathtub </td>
  175. <td><p class="lhc"><img src="http://www.globalwritersclub.com/gwc/img/bulletx.gif" width="40px" height="36px" alt=""></p></td>
  176. <td class="lhl"> } 3 the bubbles </td>
  177. </tr>
  178.  
  179. <tr>
  180. <td colspan="3"><p class="lhc"><img src="http://www.globalwritersclub.com/gwc/img/linkbanner6.jpg" width="100%" height="4px" alt=""></p></td></tr>
  181.  
  182. </table>
  183. </td></tr>
  184. </table>
  185. </body>
  186. </html>
  187.  
Feb 4 '10 #1

✓ answered by Dormilich

I must have been blind for not noticing at once …

Expand|Select|Wrap|Line Numbers
  1. <link type="text/javascript" href="http://www.globalwritersclub.com/gaming/2/word/xw/fr/1a.js">
<link> is wrong. scripts are always loaded via <script>

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="http://www.globalwritersclub.com/gaming/2/word/xw/fr/1a.js"></script>

4 4263
Dormilich
8,658 Expert Mod 8TB
a link would help more.
Feb 4 '10 #2
tpgames
785 512MB
The link
Its a crossword puzzle, with answers in french, but clues in english.
Feb 4 '10 #3
Dormilich
8,658 Expert Mod 8TB
I must have been blind for not noticing at once …

Expand|Select|Wrap|Line Numbers
  1. <link type="text/javascript" href="http://www.globalwritersclub.com/gaming/2/word/xw/fr/1a.js">
<link> is wrong. scripts are always loaded via <script>

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="http://www.globalwritersclub.com/gaming/2/word/xw/fr/1a.js"></script>
Feb 5 '10 #4
tpgames
785 512MB
LOL I KNEW there was something very obvious I missed. Even I know that! I can't believe I wrote 'link' instead of 'script'. lol Thanks!
Feb 5 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: JS | last post by:
I am writing som C code and was wondering if I should call the filename the same as the name of my function. It compiles ok but should I make a file for each funtion just to keep it orderly or is...
15
by: Johan | last post by:
Hi, I've been working on the following piece of code and it works fine in IE and Opera, dut keep getting the same error in Firefox. Can anyone tell me what's wrong with this code? What I'm...
1
by: mb | last post by:
Hi, I picked up this JavaScript code (quiz code) at: http://javascript.internet.com/miscellaneous/multiple-choice-quiz.html and modified it (and may have deleted some line I shouldn't have) so...
39
by: eruanion | last post by:
Hi, I've been working on this for a while now and I can't seem to find out what is wrong with my code. I have 2 files one c3common.js which only contains javascript functions for my main html page...
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: ...
2
by: curious2007 | last post by:
During the linking I get the following: 1>Linking... 1>main.obj : error LNK2005: "double __cdecl sigma(class curious2007::pair<double,double> const &)" (?sigma@@YANABV?$pair@NN@curious2007@@@Z)...
7
by: gregp1 | last post by:
Hi guys, Here's the code I'm to refer to: <html> <body> .... <form method="get" action="http://www.google.com/search" name="google" />
3
by: drawol | last post by:
hi im getting the above error message in firefox, when trying to display DisplayTable(tbody); function im fairly new to java script as you can prob tell. but this code works with IE. i get...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
1
by: kigoobe | last post by:
Hi I'm having a few issues and was wondering if I could get some help from here. Well, we call ajax from a page with an event handler, like onclick. Then, we have a second page where we have...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.