XmlHttpRequest与jQuery [英] XmlHttpRequest vs jQuery

查看:104
本文介绍了XmlHttpRequest与jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对javascript和jQuery都是陌生的.我正在开发一个页面,其中已从代码生成页面的整个html.在页面中,有一个用于发布消息的文本框,并且可以为每个消息发布评论.现在,当我发布新评论或删除评论时,我需要进行数据库调用. 我知道有两种方法可以从js中完成

I am new to both javascript and jQuery. I am developing a page in which I have generated page's whole html from code. In the page, there in a textbox to post messages and for each message comments can be posted. Now when I post a new comment or delete a comment I need to do database call. I know 2 method to do it from js

  1. 执行xmlhttprequest
  2. 从jQuery进行ajax调用.

有人可以建议我哪种方法适合我的需求吗?

Can anybody suggest me which method will suite my requirement?

推荐答案

每个浏览器都有自己的XmlHttpRequest实现.使用框架可以最大程度地减少跨浏览器差异和怪癖的麻烦,特别是如果您是新手.

Each browser has their own implementation of XmlHttpRequest. Using a framework will minimize the headache of cross-browser differences and quirks, especially if you are very new.

这篇关于XmlHttpRequest与jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆