Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how embed .js file inside a .js file using document.write()

Status
Not open for further replies.

saharawat

Programmer
May 17, 2001
1
IN
When I write the following code to create a dynamically html page. This code works properly in IE5 but it doesn't work with NS4.6 (i am using). The problem is that it does not embed the SEARCHCOPY.JS file. Please help me, please help me
// SEARCH.HTML FILE
//
<HTML> <HEAD><TITLE>Result Page</TITLE> <script language=&quot;javascript&quot; src=&quot;searchcopy.js&quot;></script> <body> <form method=&quot;POST&quot; name=&quot;frmsrch&quot; action=&quot;javascript:search()&quot;> Search <input type=&quot;text&quot; name=&quot;srch&quot; size=&quot;10&quot; VALUE=&quot;HELLO&quot;> <input type=&quot;button&quot; onClick=&quot;search()&quot; value=&quot;Go&quot; name=&quot;go&quot;> </form> </BODY> </HTML>
// SEARCH.JS FILE
// IN THIS FILE AGIAN I AM GENERATING THE ABOVE HTML PAGE AFTER DISPLAYING ALERT MESSAGE.
//
function search() { alert(&quot;Create same page using document.write methods&quot;); document.write(&quot;<HTML>&quot;); document.write(&quot;<HEAD>&quot;); document.write(&quot;<TITLE>Result Page&quot;); document.write(&quot;</TITLE>&quot;);
// PROBLEM IS HERE NETSCAPE 4.6 DOES NOT EMBED THIS FILE AGAIN WHY? document.write(&quot;<script language='javascript' src='searchcopy.js'>&quot;); document.write(&quot;</script>&quot;); // document.write(&quot;<body>&quot;); document.write(&quot;<form method='POST' name='frmsrch' action='javascript:search()'>Search&quot;); document.write(&quot;<input type='text' name='srch' size='10'>&quot;); document.write(&quot;<input type='button' value='Go' onClick='search()'>&quot;); document.write(&quot;</form>&quot;); document.write(&quot;</BODY>&quot;); document.write(&quot;</HTML>&quot;); document.close(); } // YOGESH UR CODE IS HERE TO CHECK ADDRESS <html> <head> <script language=javascript> </script> </head> <body onLoad=&quot;check()&quot;> </body> </html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top