2024年前端最全node博客项目,2024春招BAT面试真题详解

ajax

1)ajax请求的原理/ 手写一个ajax请求?
2)readyState?
3)ajax异步与同步的区别?
4)ajax传递中文用什么方法?

ajax.PNG

前12.PNG

开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

const blogl = (method,urlinfo) => {

if (method == ‘get’ && urlinfo.pathname == ‘/api/blog/list’) {

return { mag: ‘获取全部列表’ }

} else if (method == ‘get’ && urlinfo.pathname == ‘/api/blog/detail’) {

return { mag: ‘获取单个列表’ }

} else if (method == ‘post’ && urlinfo.pathname == ‘/api/blog/new’) {

return { mag: ‘添加一个博客’ }

} else if (method == ‘post’ && urlinfo.pathname == ‘/api/blog/update’) {

return { mag: ‘更新博客列表’ }

} else if (method == ‘post’ && urlinfo.pathname == ‘/api/blog/del’) {

return { mag: ‘删除列表’ }

}

}

module.exports = {

blogl

}

  1. user.js代码

const blogu = () => {

if (method == ‘post’ && urlinfo.pathname == ‘/api/user/login’) {

return JSON.stringify({ mag: ‘登录’ })

}

}

module.exports = {

blogu

}

  1. app.js

const http = require(‘http’)

const url = require(‘url’)

//引入 blog.js 路由文件

const { blogl } = require(‘./src/router/blog’)

const server = http.createServer((req, res) => {

//设置返回格式为JSON格式

res.setHeader(‘content-type’, ‘application/json’)

//获取客户端请求的方式

let method = req.method.toLocaleLowerCase()

let urlinfo = url.parse(req.url, true)

/**

  • urlinfo.query: [Object: null prototype] { name: ‘zss’, age: ‘20’ }

  • urlinfo.pathname: ‘/list’

*/

//执行博客的路由判断

let reuslt = blogl(method, urlinfo)

if (reuslt) {

res.end(JSON.stringify(reuslt))

return

}

//设置http的响应码为404

res.writeHead(404, {

‘content’: ‘text/plain;charset=utf8’

Vue

  • 什么是MVVM?

  • mvvm和mvc区别?它和其它框架(jquery)的区别是什么?哪些场景适合?

  • 组件之间的传值?

  • Vue 双向绑定原理

  • 描述下 vue 从初始化页面–修改数据–刷新页面 UI 的过程?

  • 虚拟 DOM 实现原理

  • Vue 中 key 值的作用?

  • Vue 的生命周期

  • Vue 组件间通信有哪些方式?

  • vue 中怎么重置 data?

  • 组件中写 name 选项有什么作用?

  • Vue 的 nextTick 的原理是什么?

  • Vuex 有哪几种属性?

    开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

  • 26
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值