- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发 Mario Kart Wii 许可证制作器,每当我添加一个按钮将其保存到我的服务器时,它就可以在我的 http://localhost 上运行。但是当我将它上传到我的网站时,它给了我。如果对您有帮助,这是我使用的 HTML/PHP、CSS 和 JavaScript。
$(document).ready(function(){
var canvas = document.getElementById("mainCanvas");
var ctx = canvas.getContext("2d");
var name = document.getElementById("name");
var favRace = document.getElementById("favRace");
var vr = document.getElementById("vrPoints");
var ranking = document.getElementById("ranking");
var favVehicle = document.getElementById("favKart");
var favVehicle2 = document.getElementById("favKart2");
var bgrnd = document.getElementById("bgrnd");
var textClr = document.getElementById("textClr");
var favChar = document.getElementById("favChar");
var secChar = document.getElementById("secChar");
var mainImg = document.getElementById("mainImg");
$("#create").click(function(){
drawRect(0, 0, bgrnd.value, 530, 300);
drawRect(0, 0, "white", 163, 173);
switch (favChar.value) {
case "Yoshi":
img = document.getElementById("yoshi");
break;
case "Baby Luigi":
img = document.getElementById("baby_luigi");
break;
case "Baby Daisy":
img = document.getElementById("baby_daisy");
break;
case "Baby Peach":
img = document.getElementById("baby_peach");
break;
case "Baby Mario":
img = document.getElementById("baby_mario");
break;
case "Toad":
img = document.getElementById("toad");
break;
case "Toadette":
img = document.getElementById("toadette");
break;
case "Koopa Troopa":
img = document.getElementById("koopa_troopa");
break;
case "Dry Bones":
img = document.getElementById("dry_bones");
break;
case "Mario":
img = document.getElementById("mario");
break;
case "Luigi":
img = document.getElementById("luigi");
break;
case "Peach":
img = document.getElementById("peach");
break;
case "Daisy":
img = document.getElementById("daisy");
break;
case "Birdo":
img = document.getElementById("birdo");
break;
case "Diddy Kong":
img = document.getElementById("diddy");
break;
case "Bowser Jr.":
img = document.getElementById("bowser_jr");
break;
case "Wario":
img = document.getElementById("wario");
break;
case "Waluigi":
img = document.getElementById("waluigi");
break;
case "Donkey Kong":
img = document.getElementById("dk");
break;
case "Bowser":
img = document.getElementById("bowser");
break;
case "King Boo":
img = document.getElementById("boo");
break;
case "Rosalina":
img = document.getElementById("rosalina");
break;
case "Funky Kong":
img = document.getElementById("funky");
break;
case "Dry Bowser":
img = document.getElementById("dry_bowser");
break;
case "Mii":
img = document.getElementById("mii");
break;
default:
img = "null";
}
drawText("Name: " + name.value, 170, 20, textClr.value, "17px Times");
drawText("Favorite Race: " + favRace.value, 170, 45, textClr.value, "17px Times");
drawText("Favorite Vehicle: " + favVehicle.value, 170, 70, textClr.value, "17px Times");
drawText("Secondary Character: " + secChar.value, 170, 95, textClr.value, "17px Times")
drawText("Secondary Vehicle: " + favVehicle2.value, 170, 120, textClr.value, "17px Times");
drawText("Overall Ranking: " + ranking.value, 170, 145, textClr.value, "17px Times");
drawText("Versus Points: " + vr.value, 170, 170, textClr.value, "17px Times");
drawImg(img, 8, 8, 150, 160);
ctx.strokeRect(0, 0, 530, 300);
drawText("Mario Kart Wii", 20, 260, textClr.value, "75px Bandits");
document.getElementById("canvasP").style.display = "block";
document.getElementById("share").style.display = "block";
canvas.style.display = "initial";
var imageURL = canvas.toDataURL();
document.getElementById("image").value = imageURL;
});
function drawRect(x, y, color, width, height) {
ctx.fillStyle = color;
ctx.fillRect(x, y, width, height);
}
function drawText(text, x, y, color, font) {
ctx.fillStyle = color;
ctx.font = font;
ctx.fillText(text, x, y);
}
function drawImg(img, x, y, width, height) {
ctx.drawImage(img, x, y, width, height);
ctx.strokeRect(0, 0, width + 14, height + 14);
ctx.strokeStyle = "black";
ctx.lineWidth = 5;
}
});
@font-face {
font-family: Bandits;
src: url("Bandits.ttf");
font-weight: bold;
}
#mainCanvas {
display: none;
}
#canvasP {
display: none;
}
.img {
display: none;
}
a {
text-decoration: none;
}
header {
background: -linear-gradient(#EEEEEE, #DDDDDD);
background: -webkit-linear-gradient(#EEEEEE, #DDDDDD);
height: 50px;
margin: -.6%;
padding: 10px;
}
#title {
font-family: Bandits;
font-size: 55px;
color: #585858;
}
body {
background-color: rgb(134, 170, 230);
}
fieldset {
width: 60%;
text-align: left;
}
.yellow {
color: yellow;
}
#license {
border: 2px solid black;
border-radius: 5px;
}
#share {
display: none;
}
<?PHP
function share() {
if (!empty($_POST)) {
define('UPLOAD_DIR', '');
define('UPLOAD_DIR2', 'licenses/');
$img = $_POST['image'];
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = UPLOAD_DIR . 'share.png';
$licenses = UPLOAD_DIR2 . uniqid() . '.png';
$success = file_put_contents($file, $data);
print $success ? $file : 'Unable to save file.';
}
}
?>
<!DOCTYPE HTML>
<HTML lang = "en">
<head>
<meta charset = "UTF-8">
<meta name = "description" content = "Create Mario Kart Wii Licenses!">
<meta name = "author" content = "Adam Oates">
<meta name = "title" content = "Mario Kart Wii License Maker">
<title title = "Mario Kart Wii License Maker | Gigaboy Web Designs">
Mario Kart Wii License Maker | Gigaboy Web Designs
</title>
<link rel = "apple-touch-icon" href = "images/logo.png">
<link rel = "shortcut icon" href = "images/logo.png">
<link rel = "stylesheet" type = "text/css" href = "main.css">
<script type = "text/javascript" src = "https://apis.google.com/js/platform.js" async defer></script>
<script type = "text/javascript" src = "http://code.jquery.com/jquery-2.1.4.js"></script>
<script type = "text/javascript" src = "main.js"></script>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'your-app-id',
xfbml : true,
version : 'v2.5'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<header>
<div id = "title">
MKWii License Maker
</div>
</header><br><br><br><br>
<section>
<div align = "center">
<form action = "" method = "post">
<fieldset>
Name: <input type = "text" name = "name" id = "name" placeholder = "Name"><br><br>
Favorite Race: <select id = "favRace">
<optgroup label = "Mushroom Cup">
<option value = "Luigi Circuit">Luigi Circuit</option>
<option value = "Moo Moo Meadows">Moo Moo Meadows</option>
<option value = "Mushroom Gorge">Mushroom Gorge</option>
<option value = "Toad's Factory">Toad's Factory</option>
<optgroup label = "Flower Cup">
<option value = "Mario Circuit">Mario Circuit</option>
<option value = "Coconut Mall">Coconut Mall</option>
<option value = "DK's Summit">DK's Summit</option>
<option value = "Wario's Gold Mine">Wario's Gold Mine</option>
<optgroup label = "Star Cup">
<option value = "Daisy Circuit">Daisy Circuit</option>
<option value = "Koopa Cape">Koopa Cape</option>
<option value = "Maple Treeway">Maple Treeway</option>
<option value = "Grumble Volcano">Grumble Volcano</option>
<optgroup label = "Special Cup">
<option value = "Dry Dry Ruins">Dry Dry Ruins</option>
<option value = "Moonview Highway">Moonview Highway</option>
<option value = "Bowser's Castle">Bowser's Castle</option>
<option value = "Rainbow Road">Rainbow Road</option>
<optgroup label = "Shell Cup">
<option value = "GCN Peach Beach">GCN Peach Beach</option>
<option value = "DS Yoshi Falls">DS Yoshi Falls</option>
<option value = "SNES Ghost Valley 2">SNES Ghost Valley 2</option>
<option value = "N64 Mario Raceway">N64 Mario Raceway</option>
<optgroup label = "Bannana Cup">
<option value = "N64 Sherbert Land">N64 Sherbert Land</option>
<option value = "GBA Shy Guy Beach">GBA Shy Guy Beach</option>
<option value = "DS Delfino Square">DS Delfino Square</option>
<option value = "GCN Waluigi Stadium">GCN Waluigi Stadium</option>
<optgroup label = "Leaf Cup">
<option value = "DS Desert Hill">DS Desert Hill</option>
<option value = "GBA Bowser's Castle 3">GBA Bowser's Castle 3</option>
<option value = "N64 DK Jungle Parkway">N64 DK Jungle Parkway</option>
<option value = "GCN Mario Circuit">GCN Mario Circuit</option>
<optgroup label = "Lightning Cup">
<option value = "SNES Mario Circuit 3">SNES Mario Circuit 3</option>
<option value = "DS Peach's Garden">DS Peach's Garden</option>
<option value = "GCN DK Mountain">GCN DK Mountain</option>
<option value = "N64 Bowser's Castle">N64 Bowser's Castle</option>
</select><br><br>
Overall Ranking: <select id = "ranking">
<option id = "e" value = "E">E</option>
<option id = "d" value = "D">D</option>
<option id = "c" value = "C">C</option>
<option id = "b" value = "B">B</option>
<option id = "a" value = "A">A</option>
<option id = "star1" value = "★">★</option>
<option id = "star2" value = "★★">★★</option>
<option id = "star3" value = "★★★">★★★</option>
</select><br><br>
Versus Points: <select id = "vrPoints">
<option id = "1000+" value = "1000+">1000+</option>
<option id = "2000+" value = "2000+">2000+</option>
<option id = "3000+" value = "3000+">3000+</option>
<option id = "4000+" value = "4000+">4000+</option>
<option id = "5000+" value = "5000+">5000+</option>
<option id = "6000+" value = "6000+">6000+</option>
<option id = "7000+" value = "7000+">7000+</option>
<option id = "8000+" value = "8000+">8000+</option>
<option id = "9000+" value = "9000+">9000+</option>
</select><br><br>
Favorite Character: <select id = "favChar">
<option value = "Baby Mario">Baby Mario</option>
<option value = "Baby Luigi">Baby Luigi</option>
<option value = "Baby Peach">Baby Peach</option>
<option value = "Baby Daisy">Baby Daisy</option>
<option value = "Toad">Toad</option>
<option value = "Toadette">Toadette</option>
<option value = "Koopa Troopa">Koopa Troopa</option>
<option value = "Dry Bones">Dry Bones</option>
<option value = "Mario">Mario</option>
<option value = "Luigi">Luigi</option>
<option value = "Peach">Peach</option>
<option value = "Daisy">Daisy</option>
<option value = "Yoshi">Yoshi</option>
<option value = "Birdo">Birdo</option>
<option value = "Diddy Kong">Diddy Kong</option>
<option value = "Bowser Jr.">Bowser Jr.</option>
<option value = "Wario">Wario</option>
<option value = "Waluigi">Waluigi</option>
<option value = "Donkey Kong">Donkey Kong</option>
<option value = "Bowser">Bowser</option>
<option value = "King Boo">King Boo</option>
<option value = "Rosalina">Rosalina</option>
<option value = "Funky Kong">Funky Kong</option>
<option value = "Dry Bowser">Dry Bowser</option>
<option value = "Mii">Mii</option>
</select><br><br>
Secondary Character: <select id = "secChar">
<option value = "Baby Mario">Baby Mario</option>
<option value = "Baby Luigi">Baby Luigi</option>
<option value = "Baby Peach">Baby Peach</option>
<option value = "Baby Daisy">Baby Daisy</option>
<option value = "Toad">Toad</option>
<option value = "Toadette">Toadette</option>
<option value = "Koopa Troopa">Koopa Troopa</option>
<option value = "Dry Bones">Dry Bones</option>
<option value = "Mario">Mario</option>
<option value = "Luigi">Luigi</option>
<option value = "Peach">Peach</option>
<option value = "Daisy">Daisy</option>
<option value = "Yoshi">Yoshi</option>
<option value = "Birdo">Birdo</option>
<option value = "Diddy Kong">Diddy Kong</option>
<option value = "Bowser Jr.">Bowser Jr.</option>
<option value = "Wario">Wario</option>
<option value = "Waluigi">Waluigi</option>
<option value = "Donkey Kong">Donkey Kong</option>
<option value = "Bowser">Bowser</option>
<option value = "King Boo">King Boo</option>
<option value = "Rosalina">Rosalina</option>
<option value = "Funky Kong">Funky Kong</option>
<option value = "Dry Bowser">Dry Bowser</option>
<option value = "Mii">Mii</option>
</select><br><br>
Vehichle Used For Favorite Character: <select id = "favKart">
<optgroup label = "Light Weight">
<option value = "Standard Kart S" id = "sks">Standard Kart S</option>
<option value = "Booster Seat" id = "bseat">Booster Seat</option>
<option value = "Mini Beast" id = "mb">Mini Beast</option>
<option value = "Cheap Charger" id = "cc">Cheap Charger</option>
<option value = "Tiny Titan" id = "tt">Tiny Titan</option>
<option value = "Blue Falcon" id = "bf">Blue Falcon</option>
<option value = "Standard Bike S" id = "sbs">Standard Bike S</option>
<option value = "Bullet Bike" id = "bb">Bullet Bike</option>
<option value = "Bit Bike" id = "bitb">Bit Bike</option>
<option value = "Quacker" id = "qkr">Quacker</option>
<option value = "Magikruser" id = "mgcCrsr">Magikruser</option>
<option value = "Jet Bubble" id = "jb">Jet Bubble</option>
<optgroup label = "Medium Weight">
<option value = "Standard Kart M" id = "skm">Standard Kart M</option>
<option value = "Classic Dragster" id = "cd">Classic Dragster</option>
<option value = "Wild Wing" id = "ww">Wild Wing</option>
<option value = "Super Blooper" id = "sb">Super Blooper</option>
<option value = "Daytripper" id = "dtrp">Daytripper</option>
<option value = "Sprinter" id = "sprnt">Sprinter</option>
<option value = "Standard Bike M" id = "sbm">Standard Bike M</option>
<option value = "Mach Bike" id = "machb">Mach Bike</option>
<option value = "Sugarscoot" id = "sugar">Sugarscoot</option>
<option value = "Zip Zip" id = "zip">Zip Zip</option>
<option value = "Sneakster" id = "sneak">Sneakster</option>
<option value = "Dolphin Dasher" id = "dphin">Dolphin Dasher</option>
<optgroup label = "Heavy Weight">
<option value = "Standard Kart L" id = "skl">Standard Kart L</option>
<option value = "Offroader" id = "offrdr">Offroader</option>
<option value = "Flame Flyer" id = "ffly">Flame Flyer</option>
<option value = "Pirahna Prowler" id = "prwlr">Pirahna Prowler</option>
<option value = "Jetsetter" id = "jetstr">Jetsetter</option>
<option value = "Honeycoupe" id = "hnycp">Honeycoupe</option>
<option value = "Standard Bike L" id = "sbl">Standard Bike L</option>
<option value = "Flame Runner" id = "frner">Flame Runner</option>
<option value = "Wario Bike" id = "wrobike">Wario Bike</option>
<option value = "Shooting Star" id = "shstr">Shooting Star</option>
<option value = "Spear" id = "spear">Spear</option>
<option value = "Phantom" id = "phntm">Phantom</option>
</select><br><br>
Vehichle Used For Secondary Character: <select id = "favKart2">
<optgroup label = "Light Weight">
<option value = "Standard Kart S" id = "sks">Standard Kart S</option>
<option value = "Booster Seat" id = "bseat">Booster Seat</option>
<option value = "Mini Beast" id = "mb">Mini Beast</option>
<option value = "Cheap Charger" id = "cc">Cheap Charger</option>
<option value = "Tiny Titan" id = "tt">Tiny Titan</option>
<option value = "Blue Falcon" id = "bf">Blue Falcon</option>
<option value = "Standard Bike S" id = "sbs">Standard Bike S</option>
<option value = "Bullet Bike" id = "bb">Bullet Bike</option>
<option value = "Bit Bike" id = "bitb">Bit Bike</option>
<option value = "Quacker" id = "qkr">Quacker</option>
<option value = "Magikruser" id = "mgcCrsr">Magikruser</option>
<option value = "Jet Bubble" id = "jb">Jet Bubble</option>
<optgroup label = "Medium Weight">
<option value = "Standard Kart M" id = "skm">Standard Kart M</option>
<option value = "Classic Dragster" id = "cd">Classic Dragster</option>
<option value = "Wild Wing" id = "ww">Wild Wing</option>
<option value = "Super Blooper" id = "sb">Super Blooper</option>
<option value = "Daytripper" id = "dtrp">Daytripper</option>
<option value = "Sprinter" id = "sprnt">Sprinter</option>
<option value = "Standard Bike M" id = "sbm">Standard Bike M</option>
<option value = "Mach Bike" id = "machb">Mach Bike</option>
<option value = "Sugarscoot" id = "sugar">Sugarscoot</option>
<option value = "Zip Zip" id = "zip">Zip Zip</option>
<option value = "Sneakster" id = "sneak">Sneakster</option>
<option value = "Dolphin Dasher" id = "dphin">Dolphin Dasher</option>
<optgroup label = "Heavy Weight">
<option value = "Standard Kart L" id = "skl">Standard Kart L</option>
<option value = "Offroader" id = "offrdr">Offroader</option>
<option value = "Flame Flyer" id = "ffly">Flame Flyer</option>
<option value = "Pirahna Prowler" id = "prwlr">Pirahna Prowler</option>
<option value = "Jetsetter" id = "jetstr">Jetsetter</option>
<option value = "Honeycoupe" id = "hnycp">Honeycoupe</option>
<option value = "Standard Bike L" id = "sbl">Standard Bike L</option>
<option value = "Flame Runner" id = "frner">Flame Runner</option>
<option value = "Wario Bike" id = "wrobike">Wario Bike</option>
<option value = "Shooting Star" id = "shstr">Shooting Star</option>
<option value = "Spear" id = "spear">Spear</option>
<option value = "Phantom" id = "phntm">Phantom</option>
</select><br><br>
License Color: <input id = "bgrnd" value = "#FFFFFF" type = "color"><br><br>
Text Color: <input id = "textClr" value = "#000000" type = "color"><br><br>
<input type = "button" name = "create" id = "create" value = "Create License">
<input type = "hidden" name = "image" id = "image" value = "">
<input type = "submit" value = "Share to Facebook" onclick = "<?PHP share(); ?>" id = "share">
</fieldset>
</form><br>
<p id = "canvasP">
Right click the image and click "Save image as..." to download license.<br>
<div class = "fb-share-button" data-href = "http://www.gigaboywebdesigns.com/mkwii-license/index.php" data-layout = "button_count"></div>
<sub>
<a href = "https://twitter.com/share" class = "twitter-share-button" data-url = "http://www.gigaboywebdesigns.com/mkwii-license/index.php">Tweet</a>
<script type = "text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<div class = "g-plus" data-action = "share" data-annotation = "bubble" data-href = "http://www.gigaboywebdesigns.com/mkwii-license/index.php"></div>
</sub><br>
<a href = "mk8.php" title = "Mario Kart 8 License Maker">
MK8 License Maker
</a>
<a href = "ssbb.php" title = "Super Smash Bros Brawl License Maker">
SSBB License Maker
</a><br>
<a href = "smk.php" title = "Super Mario Kart License Maker">
SMK License Maker
</a>
<a href = "mk64.php" title = "Mario Kart 64 License Maker">
MK64 License Maker
</a><br>
<a href = "mk7.php" title = "Mario Kart 7 License Maker">
MK7 License Maker
</a>
</p>
<canvas width = "530" height = "300" id = "mainCanvas"></canvas>
</div>
<img src = "images/yoshi.png" id = "yoshi" class = "img">
<img src = "images/baby_mario.png" id = "baby_mario" class = "img">
<img src = "images/baby_luigi.png" id = "baby_luigi" class = "img">
<img src = "images/baby_daisy.png" id = "baby_daisy" class = "img">
<img src = "images/baby_peach.png" id = "baby_peach" class = "img">
<img src = "images/toad.png" id = "toad" class = "img">
<img src = "images/toadette.png" id = "toadette" class = "img">
<img src = "images/dry_bones.png" id = "dry_bones" class = "img">
<img src = "images/koopa_troopa.png" id = "koopa_troopa" class = "img">
<img src = "images/mario.png" id = "mario" class = "img">
<img src = "images/luigi.png" id = "luigi" class = "img">
<img src = "images/peach.png" id = "peach" class = "img">
<img src = "images/daisy.png" id = "daisy" class = "img">
<img src = "images/birdo.png" id = "birdo" class = "img">
<img src = "images/diddy.png" id = "diddy" class = "img">
<img src = "images/bowser_jr.png" id = "bowser_jr" class = "img">
<img src = "images/wario.png" id = "wario" class = "img">
<img src = "images/bowser.png" id = "bowser" class = "img">
<img src = "images/waluigi.png" id = "waluigi" class = "img">
<img src = "images/dk.png" id = "dk" class = "img">
<img src = "images/boo.png" id = "boo" class = "img">
<img src = "images/dry_bowser.png" id = "dry_bowser" class = "img">
<img src = "images/rosalina.png" id = "rosalina" class = "img">
<img src = "images/funky.png" id = "funky" class = "img">
<img src = "images/mii.jpg" id = "mii" class = "img">
</section>
<footer>
</footer>
</body>
</HTML>
禁止
您无权访问此服务器上的/mkwii-license/。
此外,在尝试使用 ErrorDocument 处理请求时遇到了 403 Forbidden 错误。
最佳答案
您正在上传文件,并且可能没有访问上传文件保存位置的权限,即 PHP 没有访问该位置的权限。如果您将上传文件夹的权限设置为 777,那么它应该可以工作。您可以使用此命令更新权限:
chmod -r 777 /upload_folder_location/
您可以使用此命令检查当前权限:
ls -al
关于javascript - 为什么我被 403 禁止?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35587968/
我有一个 html 格式的表单: 我需要得到 JavaScript在value input 字段执行,但只能通过表单的 submit .原因是页面是一个模板所以我不控制它(不能有
我管理的论坛是托管软件,因此我无法访问源代码,我只能向页面添加 JavaScript 来实现我需要完成的任务。 我正在尝试用超链接替换所有页面上某些文本关键字的第一个实例。我还根据国家/地区代码对这些
我正在使用 JS 打开新页面并将 HTML 代码写入其中,但是当我尝试使用 document.write() 在新页面中编写 JS 时功能不起作用。显然,一旦看到 ,主 JS 就会关闭。用于即将打开的
提问不是为了解决问题,提问是为了更好地理解系统 专家!我知道每当你将 javascript 代码输入 javascript 引擎时,它会立即由 javascript 引擎执行。由于没有看过Engi
我在一个文件夹中有两个 javascript 文件。我想将一个变量的 javascript 文件传递到另一个。我应该使用什么程序? 最佳答案 window.postMessage用于跨文档消息。使
我有一个练习,我需要输入两个输入并检查它们是否都等于一个。 如果是 console.log 正则 console.log false 我试过这样的事情: function isPositive(fir
我正在做一个Web应用程序,计划允许其他网站(客户端)在其页面上嵌入以下javascript: 我的网络应用程序位于 http://example.org 。 我不能假设客户端网站的页面有 JQue
目前我正在使用三个外部 JS 文件。 我喜欢将所有三个 JS 文件合而为一。 尽一切可能。我创建 aio.js 并在 aio.js 中 src="https://code.jquery.com/
我有例如像这样的数组: var myArray = []; var item1 = { start: '08:00', end: '09:30' } var item2 = {
所以我正在制作一个 Chrome 扩展,它使用我制作的一些 TamperMonkey 脚本。我想要一个“主”javascript 文件,您可以在其中包含并执行其他脚本。我很擅长使用以下行将其他 jav
我有 A、B html 和 A、B javascript 文件。 并且,如何将 A JavaScript 中使用的全局变量直接移动到 B JavaScript 中? 示例 JavaScript) va
我需要将以下整个代码放入名为 activate.js 的 JavaScript 中。你能告诉我怎么做吗? var int = new int({ seconds: 30, mark
我已经为我的 .net Web 应用程序创建了母版页 EXAMPLE1.Master。他们的 I 将值存储在 JavaScript 变量中。我想在另一个 JS 文件中检索该变量。 示例1.大师:-
是否有任何库可以用来转换这样的代码: function () { var a = 1; } 像这样的代码: function () { var a = 1; } 在我的浏览器中。因为我在 Gi
我收到语法缺失 ) 错误 $(document).ready(function changeText() { var p = document.getElementById('bidp
我正在制作进度条。它有一个标签。我想调整某个脚本完成的标签。在找到可能的解决方案的一些答案后,我想出了以下脚本。第一个启动并按预期工作。然而,第二个却没有。它出什么问题了?代码如下: HTML:
这里有一个很简单的问题,我简单的头脑无法回答:为什么我在外部库中加载时,下面的匿名和onload函数没有运行?我错过了一些非常非常基本的东西。 Library.js 只有一行:console.log(
我知道 javascript 是一种客户端语言,但如果实际代码中嵌入的 javascript 代码以某种方式与在控制台上运行的代码不同,我会尝试找到答案。让我用一个例子来解释它: 我想创建一个像 Mi
我如何将这个内联 javascript 更改为 Unobtrusive JavaScript? 谢谢! 感谢您的回答,但它不起作用。我的代码是: PHP js文件 document.getElem
我正在寻找将简单的 JavaScript 对象“转储”到动态生成的 JavaScript 源代码中的最优雅的方法。 目的:假设我们有 node.js 服务器生成 HTML。我们在服务器端有一个对象x。
我是一名优秀的程序员,十分优秀!