首页 \ 问答 \ ASP.Net web api Vs .Net核心web api(ASP.Net web api Vs .Net core web api)

ASP.Net web api Vs .Net核心web api(ASP.Net web api Vs .Net core web api)

我正在google上探讨在web api版本2.0 / 2.1 / 2.2与.Net核心web api的性能观点方面的差异,但是没有得到点答案。 是.Net核心Web Api很快吗? 是的如何?


I am exploring on google the differences specially in terms of performance point of view in web api version 2.0/2.1/2.2 with .Net core web api, but did'nt get to the point answer. Is that .Net core Web Api is fast? Is yes how?


原文:https://stackoverflow.com/questions/48258090
更新时间:2023-01-06 14:01

最满意答案

以这种方式格式化您的代码,并且 不需要使用 noConflict() 调用jQuery.noConflict(); 在jQuery和MooTools库被加载后。

<script type="text/javascript">
(function($){
    var name = "#floatMenu",
        menuYloc = null;
    $(document).ready(function(){
        menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
        $(window).scroll(function () { 
            var offset = menuYloc+$(document).scrollTop()+"px";
            $(name).animate({top:offset},{duration:500,queue:false});
        });
    });
})(jQuery);
</script>

这会将你的代码封装到一个将被传递给jQuery对象的函数中。 任何你在该函数中使用$地方都会引用jQuery

此外,没有属性language的值为"text/javascript" ,它是type属性,它应该具有该值。 不要再使用language属性。


Format your code this way, and there is no need to use noConflict(). Call jQuery.noConflict(); right after the jQuery and MooTools library have been loaded.

<script type="text/javascript">
(function($){
    var name = "#floatMenu",
        menuYloc = null;
    $(document).ready(function(){
        menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
        $(window).scroll(function () { 
            var offset = menuYloc+$(document).scrollTop()+"px";
            $(name).animate({top:offset},{duration:500,queue:false});
        });
    });
})(jQuery);
</script>

This will encapsulate your code to a function, which will be passed the jQuery object. Anywhere you use $ inside that function it will reference jQuery.

Also, there is no attribute language with the value "text/javascript", it's the type attribute, which should have that value. Don't use the language attribute anymore.

相关问答

更多
  • $ function / object存在于两个库(MooTools和jQuery)中。 如果你想同时使用它们,你将不得不使用其中一个使用库名:例如jQuery('slideout').addEvent(...而不是$('slideout').addEvent(... 有用的链接: http://api.jquery.com/jQuery/ http://docs.jquery.com/Using_jQuery_with_Other_Libraries The $ function/object is pr ...
  • 以这种方式格式化您的代码,并且 不需要使用 noConflict() 。 调用jQuery.noConflict(); 在jQuery和MooTools库被加载后。 然后,您需要使用j$查找/替换所有jQuery $引用,最好使用大多数代码编辑器中的自动工具。 你也有另一种选择,封闭。 如果我没有记错,它会看起来像这样: (function($) { //jQuery stuff })(jQuery); 你需要将所有现有的代码移动到这个函数中。 它的作用域是$变量,所以你可以像平常一 ...
  • 在调用jQuery.noConflict()您只需将jQuery对象称为jQuery而不是$ 。 您的代码需要更新以反映这一点: $(document).ready(); 会成为 $.noConflict(); jQuery(document).ready(); After making the call to jQuery.noConflict() you just need to refer to the jQuery object as jQuery instead of $. Your code ...
  • 因为他们都使用$字符。 使用$ .noConflict()来修复 为什么需要使用这两个库有特别的原因吗? Because they both use the $ character. Use $.noConflict() to fix Is there a particular reason why you need to use both libraries?
  • 你错误地瞄准了这个元素......我认为这与可能的冲突无关。 在这种情况下,您需要为类的id或句点添加哈希 ,如下所示: $('#sendname').addEvent('click', function(e){ // do stuff. }); 注意#sendname的# As described in the comments to the OP, the issue was the load-order of the jQuery/Mootools scripts. The jQuery n ...
  • 如果其他东西已经定义它,Mootools不会声明$ 。 因此,如果你确保在Mootools之前加载jQuery, $仍然是一个jQuery $ (即:将jquery