如何存储jQuery函数的结果并将其显示在其他页面上

我坚持这个..我在一个页面上jquery,根据用户输入的值运行并在同一页面上显示结果。 它的工作正常,但我不想在那上面显示,但在下一页。
怎么做?
我听说通过ajax调用我可以将结果发送到php并可以存储在那里,但我不知道该怎么做或者如果有简单的方法呢?

Please Select Under 35 35 - 44">35 - 44 45 - 54">45 - 54 55 - 59">55 - 59 60 - 64">60 - 64 65 - 69">65 - 69 70 - 74">70 - 74 75 - 79">75 - 79 80 +
Please Select 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
$0
$("#next").click(function update_pricing() { //pricing data for pricing table var pricing_data = { single: { "0" : [0, 0, 0], "Under 35": [46.75, 124.25, 152.25], ">35 - 44": [51.75, 138.25, 168.50], ">45 - 54": [59.00, 152.25, 195.50], ">55 - 59": [63.25, 160.00, 209.00], ">60 - 64": [71.00, 170.50, 220.50], ">65 - 69": [58.50, 144.25, 187.00], ">70 - 74": [71.25, 187.50, 229.00], ">75 - 79": [77.50, 225.00, 303.75], "80 +" : [97.25, 275.75, 366.00] }, couple: { "0" : [0, 0, 0], "Under 35": [88.75, 236.75, 288.50], ">35 - 44": [99.00, 262.75, 320.75], ">45 - 54": [112.00, 288.50, 371.25], ">55 - 59": [120.25, 303.75, 397.50], ">60 - 64": [134.75, 323.75, 419.25], ">65 - 69": [111.25, 275.25, 355.50], ">70 - 74": [135.25, 356.50, 435.25], ">75 - 79": [147.75, 427.75, 577.00], "80 +" : [184.50, 523.50, 696.00] }, family: { "0" : [0, 0, 0], "Under 35": [116.50, 310.50, 379.00], ">35 - 44": [129.50, 345.25, 421.00], ">45 - 54": [147.25, 379.00, 488.25], ">55 - 59": [157.50, 399.00, 522.25], ">60 - 64": [177.00, 425.25, 551.50], ">65 - 69": [146.25, 361.25, 467.25], ">70 - 74": [177.50, 468.75, 572.50], ">75 - 79": [194.00, 562.25, 759.00], "80 +" : [242.50, 688.50, 914.75] } } var age_order = { "0" : 0, "Under 35": 1, ">35 - 44": 2, ">45 - 54": 3, ">55 - 59": 4, ">60 - 64": 5, ">65 - 69": 6, ">70 - 74": 7, ">75 - 79": 8, "80 +" : 9 } var age_fields = $('select[id^="dep_age_"], #age'); var family_size = parseInt($('#person').val()); var max_age = "0"; function do_update() { var pricing_set; //grab appropriate pricing set from pricing data if (family_size == 0) { pricing_set = pricing_data.single[max_age]; } else if (family_size === 1) { pricing_set = pricing_data.couple[max_age]; } else if (family_size > 1) { pricing_set = pricing_data.family[max_age]; } var price_carrier = $('.alli'); //put price values here in pricing tables //if appropriate pricing set is grabbed (not true when either one of age or family size not selected) if (pricing_set) { //put price values in all pricing tables price_carrier.each(function (i, el) { //if family members are more than 6, increase prices by 30% if (family_size > 6) { $(el).text('$' + (pricing_set[i] + pricing_set[i] * 0.3).toFixed(2)); } else { $(el).text('$' + pricing_set[i].toFixed(2)); } }); } }; age_fields.each(function () { if (age_order[$(this).val()] > age_order[max_age]) { max_age = $(this).val(); } }); do_update(); })

如果您不想使用AJAX / PHP,那么您可以使用HTML5中引入的浏览器的localStorage或sessionStorage,如下所示:

如果您的结果存储在id= "results"的元素中,那么您可以将其存储在locaStorage中:

 localStorage.setItem('titles', $('#results').text()); 

并获取任何其他页面上的项目使用:

 var myItem = localStorage.getItem('titles'); 

有关本地和会话存储的更多信息:
本地存储
会话存储