首页 \ 问答 \ AJAX .post异步(AJAX .post async)

AJAX .post异步(AJAX .post async)

具体做法如下:

      $.ajax({
            type: "POST",
            async: false,

VS

      $.ajax({
             type: "POST",
             async: true,

这意味着行为有什么不同?


What exactly does the following do:

$.ajax({
     type: "POST",
     async: false,

vs

$.ajax({
    type: "POST",
    async: true,

Meaning what is the difference in the behavior?


原文:https://stackoverflow.com/questions/10802156
更新时间:2023-06-06 18:06

最满意答案

你试过重装你的显示器吗? 有时gitk有点困惑,但是退出并重新启动它,或者重新加载( File > ReloadCtrl - F5 )可以帮助它以更友好的方式重新绘制历史记录。

编辑 :现在我看到了存储库,我可以看到发生了什么。

看起来你在master上做了一些开发,同时也在一些分支机构上工作。 当你这样做的时候,你将master多次合并到那些side分支中。 gitk在列表中显示提交,因此需要提交的线性排序。 每当您有分支历史记录时,您可以将该历史记录放入几个可能的线性排序。例如,以下结构:

       /-- c -- e --\
a -- b               g -- h
       \-- d -- f --/

可以通过以下任何一种方式订购:

  1. a,b,c,e,d,f,g,h
  2. a,b,c,d,e,f,g,h
  3. a,b,c,d,f,e,g,h
  4. a,b,d,c,e,f,g,h
  5. a,b,d,c,f,e,g,h
  6. a,b,d,f,c,e,g,h

默认情况下, gitk使用拓扑排序,它尝试将每个分支上的提交组合在一起,这样您就可以看到每个分支的提交的逻辑进程,而不是根据它们发生的时间散布分支的每一侧的提交。 因此,例如,它可能会在排序中显示它们(1):

a -- b -- c -- e ------------ g -- h
       \----------- d -- f --/

如果您只是查看线性日志,这种排序可以正常工作,如果您不经常在分支之间进行合并,也可以在gitk正常工作(如给出的示例中所示)。 但是如果你做了你做的事情,经常将master合并到主题分支中,那么这会产生你所看到的那种混乱; 首先显示master上的提交,然后显示侧支路上的提交,但是master频繁地合并到侧支路中会成为堆积起来的长连接并使历史看起来令人困惑。 (请注意,Git实际上并不存储哪个提交来自哪个分支,但是它对它们进行排序的方式最终将每个分支的提交保持在一起,看起来如此)。

我知道的最简单的处理方法就是按时间顺序显示gitk中的提交。 打开视图 > 编辑视图... ,然后选中严格按日期排序选项。 现在您应该看到您的历史显示得更加清晰。 要直接启动到此视图,您可以将--date-order选项传递给gitk


Have you tried reloading your display? Sometimes gitk gets a bit confused, but quitting and restarting it, or reloading (File > Reload, or Ctrl-F5) can help it re-draw the history in a more friendly fashion.

edit: Now that I see the repository, I can see what's going on.

It looks like you did some development on master, while also working on some side branches. While you were doing this, you merged master into those side branches several times. gitk displays commits in a list, so it needs a linear ordering of commits. Whenever you have branching history, there are several possible linear orderings you can put that history in. For instance, the following structure:

       /-- c -- e --\
a -- b               g -- h
       \-- d -- f --/

Could be ordered an any of the following ways:

  1. a, b, c, e, d, f, g, h
  2. a, b, c, d, e, f, g, h
  3. a, b, c, d, f, e, g, h
  4. a, b, d, c, e, f, g, h
  5. a, b, d, c, f, e, g, h
  6. a, b, d, f, c, e, g, h

By default, gitk uses a topological ordering, which tries to group together commits on each branch, so you can see a logical progression of commits for each branch, rather than commits of each side of the branch interspersed based on when they happened. So, for instance, it might display them in ordering (1):

a -- b -- c -- e ------------ g -- h
       \----------- d -- f --/

This ordering works fine if you're just looking at a linear log, and also works fine in gitk if you don't merge between the branches very often (as in the example given). But if you do what you did, merging master into the topic branches frequently, then this produces the kind of mess that you're seeing; the commits on master are shown first, then the commits on the side branches, but the frequent merging of master into the side branches become the long connections that pile up and make the history look confusing. (Note that Git doesn't actually store which commits came from which branch, but the way it sorts them it winds up keeping the commits from each branch together, it appears).

The easiest way to deal with this that I know of is just to display commits in gitk in chronological order. Open View > Edit view..., and check the Strictly sort by date option. Now you should see your history displayed much more sanely. To launch directly into this view, you can pass the --date-order option into gitk.

相关问答

更多
  • 您可以创建一个仅显示本地分支的新“视图”,如下所示: 转到视图 - >新视图...(或按Shift-F4) 在出现的对话框中,给“视图名称”一些有意义的内容,如“本地分支” 检查“参考”区域中的“所有(本地)分支” 选中“记住此视图”以保存这些设置以备将来启动 现在,您应该在“查看”菜单中看到“本地分支”选项。 选择此视图将只显示当地分支机构的提交。 请注意,您仍然可以看到远程分支标签,但只有在它们指向的提交位于本地分支时才会出现。 After some experimenting I have found ...
  • 如果已经提交了上游/主服务器,则相关提交不再是其HEAD,并且git log将不会提及。 另一台机器尚未收到新的提交。 编辑(更多解释):-- --decorate查看所有参考 (分支的所有标记和提示,包括本地和远程),看看它们中的任何一个是否指向提交。 所以当一个新的提交出现时,提交不再是分支的提示,并且不再被--decorate提及。 但--decorate实际上并没有为它的引用查询远程回购,它只检查它的本地副本(所有git回收都包含完整的本地远程副本)。 这个本地副本必须使用例如git fetch手动 ...
  • 正确的是,1.7.12.4(Apple Git-37)并没有使用gitk。 您可以使用brew安装gitk附带的更新版本的git。 更详尽的说明: http : //www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/ 在终端运行以下命令: brew update brew install git 如果您收到错误指示无法连接git,那么您可能需要更改其提到的文件的权限/所有者。 一旦完成,运行: which g ...
  • 而不是重置你的分支,只是签出你意味着作为你的头的提交ID git checkout 这样你就可以拥有一个独立的头,你的工作副本将会在那个提交中。 当你认为自己很好时,你可以回到你之前的分支: git checkout Instead of resetting your branch, just checkout the commit ID you mean to have as your HEAD git checkout That w ...
  • 如果左分支是当前本地HEAD所在的分支,那么您可能会尝试首先检出那个带有“右”分支的gitk log (我意识到它是 - 穷人 - 解决方法,但我的观点是: gitk不会为你做这件事)。 但是,据我所知, gitk不会显示一个分支而不是另一个分支或检测到“最繁忙”分支。 只有日志选项可以影响提交历史的表示方式(如“ 在git中可视化分支拓扑 ”)。 If the left branch is the one where the current local HEAD is, then you might tr ...
  • 你可以通过指定它作为gitk命令的参数来指定你想要的分支。 我假设你已经在使用 - 所有的,但你可能有兴趣知道,也有一个--not标志...虽然它有一些副作用,并且在大多数情况下不是很有用。 考虑一下如下所示的存储库: git checkout feature-B gitk --all 如果你没有指定参数,你只能得到你所在的分支: gitk 如果你指定多个分支,你会得到那些分支和完全合并的分支(即它们不会“伸出”)。 例如,在这里,我有feature-B , feature-C ,以及完全合并的feat ...
  • 没有--all参数,gitk只显示当前HEAD的父提交。 当用这个参数调用gitk时,你应该看到所有提交的全部历史记录(以及所有标记)。 Without the --all parameter, gitk shows only parent commits of your current HEAD. When calling gitk with this parameter, you should see the entire history with all commits (and all tags). ...
  • 那个帖子提到了在“All Branches”模式下打开gitg的可能性: gitg -- --all 它还提到它可能不适用于当前版本的gitg ( 错误报告仍然未经证实) 正如OP aGr所 提到的 ,Branch组合框中有一个选项“All branches”: 但结账后这不是一个持久的选择。 That thread mentions the possibility to open gitg in "All Branches" mode: gitg -- --all It also mentions t ...
  • 我做了一些实验(我不是控制台人员): git branch -rd $( git branch -r | grep 'wr/' ) 现在,如果我能添加一个干运行开关... Took me a bit of experimentation (I am not a console person): git branch -rd $( git branch -r | grep 'wr/' ) Now if only I could add a dry run switch...
  • 你试过重装你的显示器吗? 有时gitk有点困惑,但是退出并重新启动它,或者重新加载( File > Reload或Ctrl - F5 )可以帮助它以更友好的方式重新绘制历史记录。 编辑 :现在我看到了存储库,我可以看到发生了什么。 看起来你在master上做了一些开发,同时也在一些分支机构上工作。 当你这样做的时候,你将master多次合并到那些side分支中。 gitk在列表中显示提交,因此需要提交的线性排序。 每当您有分支历史记录时,您可以将该历史记录放入几个可能的线性排序。例如,以下结构: ...

相关文章

更多

最新问答

更多
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • 电脑高中毕业学习去哪里培训
  • 电脑系统专业就业状况如何啊?
  • IEnumerable linq表达式(IEnumerable linq expressions)
  • 如何在Spring测试中连接依赖关系(How to wire dependencies in Spring tests)
  • Solr可以在没有Lucene的情况下运行吗?(Can Solr run without Lucene?)
  • 如何保证Task在当前线程上同步运行?(How to guarantee that a Task runs synchronously on the current thread?)
  • 在保持每列的类的同时向数据框添加行(Adding row to data frame while maintaining the class of each column)
  • 的?(The ? marks in emacs/haskell and ghc mode)
  • 一个线程可以调用SuspendThread传递自己的线程ID吗?(Can a thread call SuspendThread passing its own thread ID?)
  • 延迟socket.io响应,并“警告 - websocket连接无效”(Delayed socket.io response, and “warn - websocket connection invalid”)
  • 悬停时的图像转换(Image transition on hover)
  • IIS 7.5仅显示homecontroller(IIS 7.5 only shows homecontroller)
  • 没有JavaScript的复选框“关闭”值(Checkbox 'off' value without JavaScript)
  • java分布式框架有哪些
  • Python:填写表单并点击按钮确认[关闭](Python: fill out a form and confirm with a button click [closed])
  • PHP将文件链接到根文件目录(PHP Linking Files to Root File Directory)
  • 我如何删除ListView中的项目?(How I can remove a item in my ListView?)
  • 您是否必须为TFS(云)中的每个BUG创建一个TASK以跟踪时间?(Do you have to create a TASK for every BUG in TFS (Cloud) to track time?)
  • typoscript TMENU ATagParams小写(typoscript TMENU ATagParams lowercase)
  • 武陟会计培训类的学校哪个好点?
  • 从链接中删除文本修饰(Remove text decoration from links)