jquery

jQuery Sortable - How to get current dragged element attribute

☆樱花仙子☆ 提交于 2021-02-18 22:08:29
问题 I am using jqueryui sortable widget. I need to get the current dragged element's data attribues. $(this).data('attribute_name') is not working here. I have also tried some other methods, but not getting the correct result. HTML <ul class="draggable-item" style="min-height:10px;"> <li data-parent="31" data-id="81" class="ui-state-default">Label</li> <li data-parent="31" data-id="86" class="ui-state-default">Max Value</li> <li data-parent="31" data-id="83" class="ui-state-default">Unit</li> <li

source mapping with assetic in symfony2

我只是一个虾纸丫 提交于 2021-02-18 21:11:53
问题 there is this cool feature Source Maps in html5. In my Symfony2 project I use jQuery mobile which uses this feature (I use the BmatznerJQueryMobileBundle for integration). In my <head> i do following: {% javascripts '@BmatznerJQueryBundle/Resources/public/js/jquery.min.js' '@BmatznerJQueryMobileBundle/Resources/public/js/jquery.mobile.min.js' %} <script src="{{ asset_url }}"></script> {% endjavascripts %} This works fine for the js files, but Chrome gets an 404 error trying to get the source

source mapping with assetic in symfony2

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-18 21:04:01
问题 there is this cool feature Source Maps in html5. In my Symfony2 project I use jQuery mobile which uses this feature (I use the BmatznerJQueryMobileBundle for integration). In my <head> i do following: {% javascripts '@BmatznerJQueryBundle/Resources/public/js/jquery.min.js' '@BmatznerJQueryMobileBundle/Resources/public/js/jquery.mobile.min.js' %} <script src="{{ asset_url }}"></script> {% endjavascripts %} This works fine for the js files, but Chrome gets an 404 error trying to get the source

bind events on body or document?

牧云@^-^@ 提交于 2021-02-18 20:12:50
问题 sometimes the users bind the events on $('body') and sometimes on $(document) $(document).on('click', someAction); $('body').on('click', someAction); Is there some reason to prefer one to another? 回答1: For me, there is mainly one reason to bind the events on $(document) and not to $('body') : no need to wait domReady (document is available before everything else) 回答2: Short answer most likely is, no, not really. The reason someone is doing it should always be that he requires to catch an

Why is my ajax post being truncated?

匆匆过客 提交于 2021-02-18 20:12:43
问题 I have just updated my mvc service to include greater error and logging. I have now got this exact error several times. But cannot replicate. Unterminated string. Expected delimiter: ". Path 'Breadcrumbs[18].Params', line 1, position 59740. at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote) at The Path is different each time, depending on what the user is sending to the server. My ajax requests generally look like this: $.ajax(myURL("SendBreadcrumbs"), { type: "POST", cache:

bind events on body or document?

时光怂恿深爱的人放手 提交于 2021-02-18 20:11:54
问题 sometimes the users bind the events on $('body') and sometimes on $(document) $(document).on('click', someAction); $('body').on('click', someAction); Is there some reason to prefer one to another? 回答1: For me, there is mainly one reason to bind the events on $(document) and not to $('body') : no need to wait domReady (document is available before everything else) 回答2: Short answer most likely is, no, not really. The reason someone is doing it should always be that he requires to catch an

bind events on body or document?

折月煮酒 提交于 2021-02-18 20:11:44
问题 sometimes the users bind the events on $('body') and sometimes on $(document) $(document).on('click', someAction); $('body').on('click', someAction); Is there some reason to prefer one to another? 回答1: For me, there is mainly one reason to bind the events on $(document) and not to $('body') : no need to wait domReady (document is available before everything else) 回答2: Short answer most likely is, no, not really. The reason someone is doing it should always be that he requires to catch an

bind events on body or document?

寵の児 提交于 2021-02-18 20:11:30
问题 sometimes the users bind the events on $('body') and sometimes on $(document) $(document).on('click', someAction); $('body').on('click', someAction); Is there some reason to prefer one to another? 回答1: For me, there is mainly one reason to bind the events on $(document) and not to $('body') : no need to wait domReady (document is available before everything else) 回答2: Short answer most likely is, no, not really. The reason someone is doing it should always be that he requires to catch an

bind events on body or document?

懵懂的女人 提交于 2021-02-18 20:11:15
问题 sometimes the users bind the events on $('body') and sometimes on $(document) $(document).on('click', someAction); $('body').on('click', someAction); Is there some reason to prefer one to another? 回答1: For me, there is mainly one reason to bind the events on $(document) and not to $('body') : no need to wait domReady (document is available before everything else) 回答2: Short answer most likely is, no, not really. The reason someone is doing it should always be that he requires to catch an

Send ajax request through CURL

大城市里の小女人 提交于 2021-02-18 20:06:35
问题 An API request needs to be sent. For some reason, the server is blocking CURL request, but it approves an XHR ajax request. I could send an ajax request, but another problem arises - Mixed content my website is served over HTTPS but the request that needs to be sent is over HTTP so I cannot use ajax. I am looking for a way to simulate ajax request through CURL, in some way, trick the server to believe that the CURL request is indeed an ajax request. Here's what I have tried. This is my CURL