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

problem including .js

mickey0
142 100+
hello,
I'm writing my own web server that take a query and respond with the page;
It seems OK. FF nothing console errors.
Problem is when I tried to include in my file html a file "javas.js": FF gets strange error as:
Expand|Select|Wrap|Line Numbers
  1. Error: missing ; before statement
  2. Source Code: http://localhost/javas.js
  3. Row: 1, Column: 5
  4. Source Code:
  5.  200 Document Follows
  6.  
I tried to do javas.js empty: the same error: where can be the error?
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script language="javascript" src="javas.js"> </script> //without this all is ok
  4. <script>
  5. function myFunc () {
  6.        for (var i=0; i < 100; i++) {
  7.             var table = document.getElementById("intro");  
  8.             var row = document.createElement("tr");
  9.             var cell = document.createElement("td");
  10.             var link = document.createElement("a");    
  11.             link.setAttribute("href", "http://www.google.com");
  12.             var linkText = document.createTextNode(" HI ");     
  13.             link.appendChild(linkText);
  14.             cell.appendChild(link);
  15.             row.appendChild(cell);
  16.             table.appendChild(row);        
  17.     }
  18. }   
  19. </script>
  20.  
  21.  </head>
  22.  <body onload="myFunc()">
  23.     <table style="width: 100%" border="5" >
  24.        <tr><td>  Rsult </td> </tr>
  25.         <tbody id="intro"> </tbody>
  26.     </table>
  27. </body>
  28. </html>
  29.  
However: the content in the page appear properly (only I'd like include a js. to do other thing)

thanks
Jan 30 '08 #1
7 1169
acoder
16,027 Expert Mod 8TB
Have you got script tags within the JavaScript file?
Jan 31 '08 #2
mickey0
142 100+
sorry, I don't know what you mean; script tags inside js file? like as <script> </script>; if you mean this, no i haven't it, only javascript code. Why?
But the problem is that the server don't display properly th page whenever I have the "line" that include include that file (it doesn't work even if the file is empty)
Jan 31 '08 #3
acoder
16,027 Expert Mod 8TB
Yes, that's what I meant. That could possibly have been the cause of this error.

When you have the error on row 1, column 5, what are the contents of the JS file?
Jan 31 '08 #4
mickey0
142 100+
sorry I forget...The page is displayed properly on local. The problem arise only when i lauch my web server and those strange errror occur....It seems that with this web server I can't include external file.....
Jan 31 '08 #5
acoder
16,027 Expert Mod 8TB
Which web server software are you using?
Jan 31 '08 #6
mickey0
142 100+
Which web server software are you using?
I using this minimal
http://www.cafeaulait.org/books/jnp3...TTPServer.java
Repeat: it works with html without .js. Maybe any changes has to do? thanks.
Jan 31 '08 #7
acoder
16,027 Expert Mod 8TB
I'm leaving this thread here to deal with the JavaScript aspect of the problem, but I've also copied it over to the Java forum.
Jan 31 '08 #8

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

Similar topics

7
by: Tim Ward | last post by:
I'm trying to make an image which is a chart of some data. The graphics code on its own works fine - this is a file which in outline is: <?php Header ('Content-Type: image/png'); $img =...
5
by: Rene Olsthoorn | last post by:
Dear readers, py2exe has a problem including libxml2. Not at building time, but at runtime. The libxml2.dll cannot be loaded... Is there anyone that NOT has the problem? (and can you drop me...
25
by: Xah Lee | last post by:
Python Doc Problem Example: gzip Xah Lee, 20050831 Today i need to use Python to compress/decompress gzip files. Since i've read the official Python tutorial 8 months ago, have spent 30...
5
by: Jerry Spence1 | last post by:
I have built a Setup file of my project and when I deploy it on another PC is crashes fairly quickly. I ran Dependancy Walker and found that it couldn't find the following files: MSCORPE.DLL...
3
by: Carramba | last post by:
Hi! I am working on script that ll generate some random data, ll need it later on to fil db for testing. but know to my problem, I have limited generation of data to different char_sets...
9
by: Alf P. Steinbach | last post by:
<what to design a C++ solution for> A Windows API /resource/ is data embedded in the executable, accessed via API functions. A resource is completely identified by the quadruple (id, type,...
12
by: Julian | last post by:
Hi, I am having problems with a function that I have been using in my program to read sentences from a 'command file' and parse them into commands. the surprising thing is that the program works...
0
by: manir | last post by:
Hi, It would really be of great help if you could suggest a solution for me. Program: I need to execute a stored procedure from an Oracle server through a C++ program using oci.h (Oracle...
4
by: Subra | last post by:
Hi, in a cpp file we are including <cstdliband indirectly including <stdlib.h>. But the definition for "strtoll" is not appearing in the .ii file generated using the -E option to gcc. ...
2
by: yogeshtiwarijbp | last post by:
By using add reference i have included microsoft excel 11.0 object library in asp.net and also included in the namespace using microsoft.office.interop.excel and using system .reflection. But the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.