本文介绍了Sweetalert根本没有显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!我目前正在使用000webhost.com托管一个网站,我想展示sweetalert。我只导入了三个文件 - sweetalert-dev.js,sweetalert.css,sweetalert.min.js。请注意,这三个文件与我的index.php位于同一个文件夹中,我正在使用此代码:

Hello! I am currently hosting a website with 000webhost.com, and I want to show sweetalert. I've only imported three of the files- sweetalert-dev.js, sweetalert.css, sweetalert.min.js. Note that these three files are in the same folder with my index.php, and I am using this code:

<head>
                <script src="script.js"></script>
		<title>SaleReader</title>
		<meta charset="utf-8" />
                <script src="sweet-alert.min.js"></script>
                <link rel="stylesheet" href="sweet-alert.css" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
                <script src="script.js"></script>
<link rel="stylesheet" type="text/css" href="sweetalert.css">
<script>swal({
  title: "Error!",
  text: "Here's my error message!",
  type: "error",
  confirmButtonText: "Cool"
});</script>
		<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
		<link rel="stylesheet" href="assets/css/main.css" />
		<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
		<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
	</head>



我不明白为什么它不起作用。起初,我使用外部脚本来使用swal,但出于测试目的,我在同一个index.php中使用它来拼出swal。请注意,如果重要的话,头部位于页面的顶部。



我尝试过:



我试过改变脚本/ css的顺序,改变他们所说的内容,例如。 src =sweet-alert.min.js等等很长的过程!请帮助!


I don't understand why it's not working. At first, I used an external script to use swal, but for testing purposes, I'm using it in the same index.php to spell out the swal. Note that the head is on the top of the page, if that matters.

What I have tried:

I've tried changing the orders of the script/css, changing what they say, for ex. src="sweet-alert.min.js" , etc. very long process! Please help!

推荐答案


这篇关于Sweetalert根本没有显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 08:48