10 examples of 'refresh div after ajax success' in JavaScript

Every line of 'refresh div after ajax success' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
91function refresh() {
92 $.ajax({
93 type: 'POST',
94 url: getPath() + '/createAllIndex',
95 success: function (data) {
96 if (data.result == 1) {
97 alert("生成索引成功!");
98 } else {
99 alert(data.msg);
100 }
101 }
102 });
103}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

33$(function refresh() {
34 $.getJSON('/', function(data, textStatus, jqXHR) {
35 $('#version').text(jqXHR.getResponseHeader('X-Pult-Version'));
36 $('#domains').empty();
37 for (var key in data) {
38 if (key == 'pult.dev') {
39 continue;
40 } else if (key == 'next') {
41 $('#next').text(data.next);
42 } else {
43 $('<a>')
44 .addClass('list-group-item')
45 .attr('href', 'http://' + key)
46 .append($('<strong>').text(key))
47 .append($('<span>').addClass('badge').text(data[key]))
48 .appendTo('#domains');
49 }
50 }
51 });
52 setTimeout(refresh, 3000);
53});
66function refresh_page() {
67 refresh_future_events();
68 refresh_future_summits();
69 refresh_past_summits();
70}
95function refresh()
96{
97 $('#info').load('info',
98 function()
99 {
100 // handle async links
101 $('a.asynclink').click(
102 function (event)
103 {
104 event.preventDefault();
105
106 var anchor = $(this);
107 $.get(anchor.attr('href'),
108 function (data)
109 {
110 refresh();
111 }
112 );
113 }
114 );
115
116 }
117 );
118}
15function change_refresh() {
16 $('#alerts').html("<div class='small alert alert-info alert-dismissible fade show' role='alert'>Please wait... Refreshing data." +
17 "</div>")
18 setTimeout(function () { run_ajax(); }, 1000)
19};
143function _refreshSuccess(data) {
144 for (var i=0; i < data['results'].length; i++) {
145 data['results'][i].karma_range = Stars(data['results'][i].karma);
146 data['results'][i].avg_rating_range = Stars(data['results'][i].avg_rating);
147 data['results'][i].avg_role_score_range = Stars(data['results'][i].avg_role_score);
148 data['results'][i].avg_role_aw_score_range = Stars(data['results'][i].avg_role_score);
149 if (data['results'][i].summary_fields.ratings.length > 0) {
150 data['results'][i].rating_range = Stars(data['results'][i].summary_fields.ratings[0].score);
151 }
152 else {
153 data['results'][i].rating_range = Stars(0);
154 }
155 }
156 $scope.users = data['results'];
157
158 $scope.list_data.page = parseInt(data['cur_page']);
159 $scope.list_data.num_pages = parseInt(data['num_pages']);
160 $scope.list_data.count = parseInt(data['count']);
161 $scope.list_data.page_range = [];
162 $scope.setPageRange();
163
164 $scope.status = "";
165 $scope.loading = 0;
166
167 // Force window back to the top
168 window.scrollTo(0, 0);
169}
181function refresh(){
182 $("#refresh_btn").button('loading');
183
184 var status;
185 var time_interval;
186
187 $('input[class="status"]').parent('label').each(function(index, element){
188 if($(this).hasClass('active')) {
189 var idx = 2-index;
190 status = idx;
191 }
192 });
193 $('input[class="time_interval"]').parent('label').each(function(index, element){
194 if($(this).hasClass('active')) {
195 var idx = 2-index;
196 time_interval = idx;
197 }
198 });
199 console.log(':::'+status+'--'+time_interval);
200
201 task_query(status, time_interval);
202
203 $("#refresh_btn").button('reset');
204
205}
25function refresh(id) {
26 if(id !== "avascript:void(0)") {
27 var iframeSelectName = "#" + id + " iframe"
28 $(iframeSelectName).attr('src', $(iframeSelectName).attr('src'));
29 }
30}
470setTimeout(function refresh() {
471 $("#block").fadeOut("slow");
472}, 1000);
19function ping_refresh()
20{
21 elem = document.getElementById('data');
22 if (elem && document.getElementById('autoscroll').checked)
23 elem.scrollTop += 1000;
24 xajax_refresh(xajax.getFormValues('params'));
25
26 setTimeout("ping_refresh()", 1000);
27}

Related snippets