将数据移动到$ .ajax了?(moving data to $.ajax's out?)
我想将“数据”变量移到其他操作的成功函数之外。
$("a[class=note]").click(function( evt ){ var note = $(this).attr("value"); var preid = $(this).attr("id"); $.ajax({ type: 'GET', url: 'style/ajax.php', data: 'do=note&value=' + note + '&preid=' + preid, success: function(data) { alert(data); } }); });
例如php有
Global
pharase ..I want to move "data" variable to out of success function for other operation.
$("a[class=note]").click(function( evt ){ var note = $(this).attr("value"); var preid = $(this).attr("id"); $.ajax({ type: 'GET', url: 'style/ajax.php', data: 'do=note&value=' + note + '&preid=' + preid, success: function(data) { alert(data); } }); });
For example php have
Global
pharase..
原文:https://stackoverflow.com/questions/8971872
更新时间:2024-04-27 13:04
最满意答案
请遵循以下步骤
1 unwind the tracks array in playlist collection 2 $lookup match with tracks collection 3 add createddate of tracks array to lookup result as a new key 4 sort based on new key 5 group the results for your requirements
Follow below steps
1 unwind the tracks array in playlist collection 2 $lookup match with tracks collection 3 add createddate of tracks array to lookup result as a new key 4 sort based on new key 5 group the results for your requirements
相关问答
更多-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
如果你需要排序和多条信息,那么你应该考虑一个哈希引用数组。 my @fields = ( { id => 'property_foo', label => 'Some property' }, { id => 'property_bar', label => 'Important field' }, { id => 'property_baz', label => 'Something else' }, ); foreach (@fields) { print "I ...
-
首先,我只会看减法结果的标志: /* returns the sign of the expression a - b */ int sign_of_subtraction_result(int a, int b) { if ( a < b ) return -1; if ( a > b ) return +1; return 0; } 你也可以调用这个函数compare() 。 请注意,通常的库分类功能仅使用此信息并需要compare()功能。 First of all, I'd ...
-
请遵循以下步骤 1 unwind the tracks array in playlist collection 2 $lookup match with tracks collection 3 add createddate of tracks array to lookup result as a new key 4 sort based on new key 5 group the results for your requirements Follow below steps 1 unwind t ...
-
发出已排序数组的哈希值(emit hash of sorted array)[2022-06-06]
我想到了。 问题是我试图对标签数组进行排序,但这在CouchDB中受到限制,因为无法修改文档属性。 因此,我必须'克隆'数组,然后对新创建的数组进行排序。 // map.js function(doc) { // create sorted array var tagsCopy = doc.tags.slice(); tagsCopy.sort(); // calculate hash var hash = ''; for (var idx in tagsC ... -
最简单的选择是使用Collectors.partitioningBy方法和Java 8的Streams and Collectors 。 import java.util.stream.Collectors; import java.util.Map; import java.util.List; import java.util.Arrays; public class Partition { public static String join(int[] a, String d) { ...
-
解决方案:要实现这一点,您必须将两个阵列压缩为一个。 这是,给你这两个数组: sortThis=[3,1,2]; sortAccording=["With 3","With 1","With 2]; 压缩后,您将拥有以下数组: zipped = [{a: 3, b: "With 3"}, {a: 1, b: "With 1"}, {a: 2, b: "With 2"}]; 然后,您按a排序,以便: zippedAndSorted = [{a: 1, b: "With 1"}, {a: 2, b: "Wi ...
-
你可以使用np.lexsort : import numpy as np a = np.array([ 1.+2.j, 5.+0.j, 1.+0.j, 1.+1.j, 1.+1.j, 1.-1.j, 6.+0.j, 1.-1.j, 1.-2.j]) sorted_idx = np.lexsort((np.sign(a.imag), np.abs(a.imag), a.real)) >>> a[sorted_idx] array([ 1.+0.j, 1.-1.j, 1.-1. ...
-
我认为您的问题可能与使用的Java类型有关。 需要查询列表而不是Map,因为Java HashMap(我想这是查询将返回的内容)不支持排序。 请参阅应返回所需内容的SqlMapDaoTemplate#queryForList()方法。 I think your problem might be with the Java types used. To need to query for a list, not for a Map, because the Java HashMap (I suppose th ...
-
已排序的数组(Already sorted array)[2022-09-27]
SorBag2 = SorBag和SorBag3 = SorBag将SorBag3 = SorBag的引用SorBag到其他两个数组,而不是仅复制数据。 所以代替: System.out.println("• Please enter the elements of Sorting Bag:"); for (int i = 0; i < SorBag.length ; i++) { SorBag[i] = input.nextInt(); } SorBag2 = SorBag; SorBag3 = ...