hi all
i have asp page in which i have some j.s functions. in order to clean up the mass in the file i want to copy those functions to js file which name will be default.js the file will be in the new folder which name is js. when i try to write the folowing code
in the asp file i got error msg. but when i cut the js finctions again into the default.asp file the functions work all write again.
did i miss something!!!????
If you are not trying to access the scripts directly in the ASP file, it should work just fine. What does the error say?
Possible the relative path is incorrect to the js file? Maybe not enough "../" or to many? Try placing the exact path for the source and see it works.
On the other hand, if you are needing the ASP script to access the function contained in the js file then you can not do that in that way. The the ASP will be processed first and then the HTML.
As long as you're processing as JS and not VBS you can include the file like this:
<!-- #include virtual="../js/default.js" -->
Then the ASP script would have access to that file as long as the above line is placed before the calling procedures.
Let me know if this does not answer your question.
thnks for reply me!!!! i attach the 2 files default.asp and default.js which make me the problems. i have tried to type the whole path and it still doesnt work.
notice the default.asp line 22 - there i wrote the linkage.
regards
Ron
On line 22 you have: <script language="JavaScript" src="../js/defaulr.js"></script>
default is misspelled. It should read: <script language="JavaScript" src="../js/default.js"></script>
See if that change works. I'm having issues with my server right
now so I can't load up the asp page right now to test. If that
doesn't work, I'll look a little more.
Another Issue/Possibility
I may be wrong, but I don't think you can use the ASP in your JS
file the way you are trying to in the CreateMail function
because the server doesn't know to process the ASP script in the
JS file. I think you'll have to pass the UserName value as a
parameter to CreateMail instead. It's a rather simple change -