Moving code into another file

D

Doug Stewart

I need help moving code from a web page into an external file. Here is the
background:

- I've taken the code for a software package, modified it, then pasted it
into my web page.

- It works fine, but complicates the HTML on-page, so I would like to move
it into a separate file. I've taken the code as-is and put it into a file
(called search_english.js), then put the following onto my web page:

<script language="JavaScript" type="text/JavaScript"
src="http://www.my-domain.com/search_english.js"></script>


When I upload the page, it doesn't seem to be able to find the code in the
JS file. Any idea what I'm doing wrong?

Not sure if I need to put anything special at the begining or the end of the
JS file. My JS file begins with the following code (which produces a form to
do a search on a database):

<form method=get
action="http://www.france-property-and-information.com/listman/exec/search.cgi">
<font color="#808000">
<input type="hidden" name="search" value="1" style="font-weight: 700">
<input type="hidden" name="perpage" value="10" style="font-weight: 700">
</font><b><font color="#808000">


etc. etc. etc.



and ends with:

</select><b> </b></font>
</td>
</tr>
</table>

<p>
<div align=center>
<font color="#808000">
<input type=submit name="search" value="Find Properties "
style="font-weight: 700"><b>
</b></font>
</div>

</td>
</tr>
</table>


<p> </p>

</body></html>

</form>
 
D

Doug Stewart

P C

Tried your suggestion. Unfortunately, still doesn't work.

Maybe I'm making a logical error. I'm not sure if the code I'm using is Java
Script or HTML. Does this approach work with HTML? Do I need to put something
at the beginning or end of the code for this to work (I've shown the start
and end of the code in my original posting)?

Doug
 
R

Rob Giordano \(Crash\)

ot
are those apartment prices real?


Doug Stewart said:
P C

Tried your suggestion. Unfortunately, still doesn't work.

Maybe I'm making a logical error. I'm not sure if the code I'm using is
Java
Script or HTML. Does this approach work with HTML? Do I need to put
something
at the beginning or end of the code for this to work (I've shown the start
and end of the code in my original posting)?

Doug
 
S

Stefan B Rusynko

The code you posted (starting with <form method=...) is not JavaScript
- its Html
a .js file can not include Html unless you have JavaScript document writes generating it




|I need help moving code from a web page into an external file. Here is the
| background:
|
| - I've taken the code for a software package, modified it, then pasted it
| into my web page.
|
| - It works fine, but complicates the HTML on-page, so I would like to move
| it into a separate file. I've taken the code as-is and put it into a file
| (called search_english.js), then put the following onto my web page:
|
| <script language="JavaScript" type="text/JavaScript"
| src="http://www.my-domain.com/search_english.js"></script>
|
|
| When I upload the page, it doesn't seem to be able to find the code in the
| JS file. Any idea what I'm doing wrong?
|
| Not sure if I need to put anything special at the begining or the end of the
| JS file. My JS file begins with the following code (which produces a form to
| do a search on a database):
|
| <form method=get
| action="http://www.france-property-and-information.com/listman/exec/search.cgi">
| <font color="#808000">
| <input type="hidden" name="search" value="1" style="font-weight: 700">
| <input type="hidden" name="perpage" value="10" style="font-weight: 700">
| </font><b><font color="#808000">
|
|
| etc. etc. etc.
|
|
|
| and ends with:
|
| </select><b> </b></font>
| </td>
| </tr>
| </table>
|
| <p>
| <div align=center>
| <font color="#808000">
| <input type=submit name="search" value="Find Properties "
| style="font-weight: 700"><b>
| </b></font>
| </div>
|
| </td>
| </tr>
| </table>
|
|
| <p> </p>
|
| </body></html>
|
| </form>
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top