图像未加载脚本

时间:2017-11-30 12:27:16

标签: html

使用此脚本时图片未加载。

<!DOCTYPE html>
<html>
<head>
    <title>test</title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"/>
</head>
<body>
    <img href="https://static.pexels.com/photos/33109/fall-autumn-red-season.jpg" width="200" height="267" alt="me">
</body>
</html>

如果删除脚本,我会收到Image.Code:

<!DOCTYPE html>
<html>
<head>
    <title>test</title>
</head>
<body>
    <img src="https://static.pexels.com/photos/33109/fall-autumn-red-season.jpg" width="200" height="267" alt="me">
</body>
</html>

3 个答案:

答案 0 :(得分:1)

您不能关闭脚本标记

使用

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>

请检查!!

<!DOCTYPE html>
    <html>
    <head>
    	<title>test</title>
    	<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
    </head>
    <body>
    	<img src="https://static.pexels.com/photos/33109/fall-autumn-red-season.jpg" width="200" height="267" alt="me">
    </body>
</html>

答案 1 :(得分:0)

#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> void error(const char *msg) { perror(msg); exit(0); } int main(int argc, char *argv[]) { int sockfd, portno, n; struct sockaddr_in serv_addr; struct hostent *server; char buffer[256]; if (argc < 3) { fprintf(stderr,"usage %s hostname port\n", argv[0]); exit(0); } portno = atoi(argv[2]); sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) error("ERROR opening socket"); server = gethostbyname(argv[1]); if (server == NULL) { fprintf(stderr,"ERROR, no such host\n"); exit(0); } bzero((char *) &serv_addr, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(portno); if (connect(sockfd,(struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0) error("ERROR connecting"); printf("Please enter the message: "); bzero(buffer,256); fgets(buffer,255,stdin); n = write(sockfd,buffer,strlen(buffer)); if (n < 0) error("ERROR writing to socket"); bzero(buffer,256); n = read(sockfd,buffer,255); if (n < 0) error("ERROR reading from socket"); printf("%s\n",buffer); close(sockfd); return 0; } 元素can't be self-closing<script>)。您必须使用<.../>关闭该元素。您的</script>元素也有错误。您正在使用属性<img>。如果href有效,您的图片仍然不可见。您必须使用属性<script>来显示图片。

&#13;
&#13;
src
&#13;
&#13;
&#13;

答案 2 :(得分:0)

尝试在正文末尾使用脚本标记。此外,脚本标记在html中不是无效元素,您没有关闭脚本标记。请尝试使用以下代码:

<head>
        <title>test</title>
</head>
<body>
    <img href="https://static.pexels.com/photos/33109/fall-autumn-red-season.jpg" width="200" height="267" alt="me" />
  <script src="https://ajax.googleapis.com/ajax/alibs/angularjs/1.6.4/angular.min.js"></script>
</body>