"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.language.this.js",
"settings": {
"foreground": "#FF0000",
"fontStyle": "bold underline"
}
}
]
}
.then(() => animation(2, 1000, log))
fn(a,b,c).then(fn(k,m,n))
animation(1, 500, log)
.then(e=>animation(2, 1000, log))
.then(e=>animation(3, 2000, log))
.then(e=>animation(4, "500", log));
$( "#result" ).load( "ajax/test.html" );
, .load. Но если проект большой, не стоит использовать этот метод, советую изучить и понять что такое SPA (single page application), а дальше выбрать фреймворк в котором вы желаете работать, это может быть ReactJS, AngularJS, VueJS, мне лично больше нравится ReactJS. Стоит заметить что изучение данных фреймворков займет не мало времени, но оно того стоит! Что бы Вы изменили в коде?
const uid = () => Math.random().toString(36).slice(2);
class App extends React.Component {
state = {
tasks: [
{
id: uid(),
title: 'title',
description: 'description',
}
]
};
handleCreateTaskClick = () => {
this.setState(state => ({
tasks: [
...state.tasks,
{
id: uid(),
title: 'title',
description: 'description',
},
],
}));
};
render() {
const { tasks } = this.state;
return (
<div>
<button onClick={this.handleCreateTaskClick}>Добавить задачу</button>
<ul>
{tasks.map(task => (
<li key={task.id}>
id: {task.id} | {task.title} | {task.description}
</li>
))}
</ul>
</div>
);
}
}
class App extends React.Component {
state = {
tasks: [
{
id: 1,
title: 'title',
description: 'description',
},
],
}
createTask = () => {
this.setState(({ tasks }) => ({
tasks: [
...tasks,
{
id: 1 + Math.max(0, ...tasks.map(n => n.id)),
title: 'title',
description: 'description',
},
],
}));
}
render() {
return (
<div>
<button onClick={this.createTask}>Добавить задачу</button>
<ul>
{this.state.tasks.map(({ id, title, description }) => (
<li key={id}>id: {id} | {title} | {description}</li>
))}
</ul>
</div>
);
}
}
class App extends React.Component {
constructor() {
super();
this.state = {
prop: 1,
}
}
stateChange = () => {
this.setState({
prop: this.state.prop + 1,
});
}
render = () => {
return <div>
<p>{this.state.prop}</p>
<input type="button" value="Обновить" onClick={() => {this.stateChange()}}/>
</div>;
}
}
ReactDOM.render(<App/>, document.getElementById('body'));
<span class="show-phones" id="tm-telephone-body" data-url="/a/ajaxPhones?id=28104015" data-id="28104015">
Показать телефон
</span>
data-url
и выполняете запрос с заголовком XMLHttpRequest
:curl -X GET \
'https://krisha.kz/a/ajaxPhones?id=28104015' \
-H 'x-requested-with: XMLHttpRequest'
["+7 707 892 8095"]
Construct1.apply(this, arguments);
.