我有这个法国字符串:
Veuillez indiquer vos spécialités
Run Code Online (Sandbox Code Playgroud)
我想在JS Alert中这样想:
Veuillez indiquer vos spécialités
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
$(function(){
alert('Veuillez indiquer vos spécialités');
});
Run Code Online (Sandbox Code Playgroud)
在这里小提琴:http://jsfiddle.net/M6rLL/
我一直在尝试用JS做一个简单的练习.一个盒子,可以在所有方向上将背景颜色从白色变为蓝色或变为紫色,也可以从紫色变为蓝色等.这是正在工作的代码,例如.我不明白为什么最后的蓝色:function()也有效.我用"尝试和检查方法"自己写了一切.也许有人可以用真正正确的方式(最简单的方式)重写代码.
<style>
#box {
width: 50px;
height: 50px;
border: 3px black solid;
}
.purple {
background: purple;
}
.blue {
background: blue;
}
.white {
background: white;
}
</style>
<div id="box"></div>
<div>
<button onclick="colorChanger.white()">White </button>
<button onclick="colorChanger.purple()">Purple </button>
<button onclick="colorChanger.blue()">Blue </button>
</div>
Run Code Online (Sandbox Code Playgroud)
和JS:
var background = document.getElementById("box");
var colorChanger = {
white: function() {
(background.classList.remove("blue") || background.classList.remove("purple"))
},
purple: function() {
(background.classList.remove("blue") || background.classList.remove("white")) & background.classList.add("purple");
},
blue: function() {
background.classList.add("blue");
}
};
Run Code Online (Sandbox Code Playgroud)
工作脚本在这里:https://codepen.io/hubkubas/pen/LJNKoJ?editors = 1010
感谢您的帮助和建议.
我对 API Platform 和 Vich Uploader 的 PUT 请求感到困惑,POST 工作得很好。
这是我的 MediaObject 实体的标头:
/**
* @ORM\Entity
* @ApiResource(
* iri="http://schema.org/MediaObject",
* normalizationContext={
* "groups"={"media_object_read"}
* },
* collectionOperations={
* "post"={
* "controller"=CreateMediaObjectAction::class,
* "deserialize"=false,
* "security"="is_granted('ROLE_USER')",
* "validation_groups"={"Default", "media_object_create"},
* "openapi_context"={
* "requestBody"={
* "content"={
* "multipart/form-data"={
* "schema"={
* "type"="object",
* "properties"={
* "file"={
* "type"="string",
* "format"="binary"
* }
* }
* }
* }
* }
* }
* }
* },
* "get",
* },
* …Run Code Online (Sandbox Code Playgroud) 我试图使用此方法减去两个值,但它对我不起作用.知道如何用这种方法减去这个吗?
<td>'.$row['sales']-$row['return'].'</td>
Run Code Online (Sandbox Code Playgroud)