Browser JS script and shared use of ASP JS scripts

xiaoxiao2021-03-06  116

I wrote a few JS files that contain several custom JavaScript objects that can be used well in the browser Script.

There is a problem with the ASP JavaScript to call these script objects, that is, if you use a #include file to embed JS scripts, then he will be explained as a text and response, because #include file embedded ASP scripts must be placed <%%> Block, there is no <%%> The script contains text to send it, in order to be used in the ASP, your JS script must be placed in <%%>.

But so that your browser script will report it because the browser script does not recognize <%%> such symbols.

I think a way, that is, in the first plus // JS annotation in front of <%%>, you can solve the problem very well, similar code blocks are as follows:

// <%

// Your JavaScript Code Block

//%>

However, it is not very perfect. After you include file, since //// is outside <%, the ASP interpreter handles it into text, and it is sent out, so that your web page is more A // symbol.

There is a way to solve it, that is, put all include files in the ASP file (these files don't response anything, just some function collection), then call a response.clear (), then all over RESPONSE has fallen to Clear. .

转载请注明原文地址:https://www.9cbs.com/read-100907.html

New Post(0)