Asp implementation of js function problem?
<meta charset="utf-8" & gt;
Title <meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt;
<meta name="viewport" content="width=device - width, initial - scale=1.0, the maximum - scale=1.0, user - scalable=no"/& gt;
<meta name="HandheldFriendly" content="true"/& gt;
<meta name="MobileOptimized" content="320"/& gt;
<%
Response. Write "& lt; Script>"
Response. Write "window. The onl oad=function () {
"Response. Write "alert ();"
Response. Write "}
"Response. Write "& lt;/script>"
% & gt;
<body>
Js:
The function deviceVibrate () {
Plus, the device vibrate ();
}
Question: I introduced into the page is to perform alert () is A success, I put the alert () with deviceVibrate () doesn't work, but I click on A TAB, is effective, why?
CodePudding user response:
Good plus haven't load, CodePudding user response:
Lord make sure that the js code plus object is introduced and execute
CodePudding user response:
This has nothing to do with asp, change & lt; Body> The location of the
First no response, directly in the page code onl oad handler look at what the problem is, the object before the call ever being loaded to come in, CodePudding user response:
According to my you do a simple test to try
<% @ LANGUAGE="VBSCRIPT" CODEPAGE="65001" % & gt;
Test <link rel="shortcut icon" href="https://bbs.csdn.net/topics/images/favicon.ico"/& gt;
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;
<body>