我正在使用Kendo UI Controls.我想在jquery中获取下拉列表的选定文本.我使用过这种语法:
$("#ddl").data("kendoDropDownList").text();
Run Code Online (Sandbox Code Playgroud)
我可以在IE以外的所有浏览器中获取文本.我不知道为什么这不适用于IE,请帮帮我.有没有其他方法可以选择文本?
我正在使用laravel 4.2,目前我不知道如何public\csv\使用AJAX 将csv文件保存到目录中.我还在寻找一些答案.也许有人可以帮助我.
这是我的代码:
在刀片视图中:
{{Form::open(['route' => 'file_upload', 'files' => true, 'id' => 'upload_form', 'method' => 'POST'])}}
{{Form::file('csv_upload', ['id' => 'uploaded_file', 'accept' => 'text/csv'])}}
{{Form::submit('submit', ['class' => 'btn btn-primary btn-xs', 'id' => 'upload'])}}
{{Form::close()}}
Run Code Online (Sandbox Code Playgroud)
Javascript Ajax:
var ajax_ready = 1
var token = {{Session::get('_token')}}
if($.type(originalOptions.data) === 'string') {
options.data = originalOptions.data+"&_token="+token;
}else if($.type(originalOptions.data) === 'object') {
//Here I got a new error
}else{
options.data = $.param(($.extend(originalOptions.data, {'_token':mmad_token})));
}
options.url = originalOptions.url.slice(0,originalOptions.url.indexOf("?_token="));
if (ajax_ready!=1){
jqXHR.abort();
}
ajax_ready = 0; …Run Code Online (Sandbox Code Playgroud) 简单对话框.jsx
const [imagePreview, setImagePreview] = React.useState(null);
const handleChangeImage = event => {
let reader = new FileReader();
let file = event.target.files[0];
reader.onload = event => {
console.log(event);
setImagePreview(event.target.result);
};
reader.readAsDataURL(file);
};
return (
<div>
<input
accept="image/*"
id="contained-button-file"
multiple
type="file"
style={{ display: 'none' }}
onChange={handleChangeImage}
/>
<img id="preview" src={imagePreview} />
</div>
);
Run Code Online (Sandbox Code Playgroud)
SimpleDialog.test.js
it('should change image src', () => {
const event = {
target: {
files: [
{
name: 'image.png',
size: 50000,
type: 'image/png'
}
]
}
};
let spy …Run Code Online (Sandbox Code Playgroud) 我很难在每个父母div上定位儿童div.
这是css代码:
.mainDiv {
height:500px;
position: relative;
}
.mainDiv .parent1 {
height: 250px;
background-color: blue;
top: 50px;
position: relative;
}
.mainDiv .parent2 {
height: 250px;
background-color: yellow;
position: relative;
}
.mainDiv .parent1 .sub1 {
width: 100px;
height: 100px;
background-color: green;
position: absolute;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
top: 50%;
}
.mainDiv .parent2 .sub2 {
width: 100px;
height: 100px;
background-color: red;
position: absolute;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
top: 50%;
}
Run Code Online (Sandbox Code Playgroud)
这是小提琴