In this tutorial we will create a regular HTML page with a small javascript code, and we will use this javascript code to include in the page new information from a ".asp" file.
First, let´s check this two pages:
javascript.html
HTML Code:
<html>
<title>My page</title>
<body>
<script language="javascript" src="javascript.asp"></script>
</body>
</html>
javascript.asp
document.write ("hello") 1
In the first file (javascript.html) we have include a javascript code in red, and within the code the file name from which we will get information to complete our page (src: source). So that we are asking for information to complete our page (javascript.html) to a different page (javascript.asp). This time we have only include the file name, but we may use the complete url even from a different site (for example: http://www.adifferentsite.com/javascript.asp).
In the second file (javascript.asp) we have include the information necessary to write in the document the word "hello". This time we have use ".asp" extensión for the second page even though other extensions are possible.
link dropping removed
Last edited by chrishirst; 05-01-2010 at 03:32 PM..
|