The Axaj freez up the browser #26

Closed
opened 2016-12-05 07:28:04 +00:00 by Llewellyn · 1 comment
Owner

When the external listing post the Ajax to do a background update of the local listing, it freezes the browser.

Here is the code

$document->addScriptDeclaration("
jQuery(window).load(function() {
	checkExternalListing(".$update.");
});

function checkExternalListing(id, target, type) {
	checkExternalListing_server(id, target, type).done(function(result) {
		// good it is done
	});
}

function checkExternalListing_server(id, target, type) {
	var getUrl = '".JURI::root()."administrator/index.php?option=com_sermondistributor&task=ajax.autoUpdateLocalListingExternal&format=json';
	if(target > 0 && type > 0 && id > 0){
		var request = 'token=".JSession::getFormToken()."&target='+target+'&listing='+id+'&type='+type;
	}
	return jQuery.ajax({
		type: 'GET',
		url: getUrl,
		dataType: 'jsonp',
		data: request,
		jsonp: 'callback'
	});
}");

The file that adds the code ../helpers/sermondistributor.php

When the external listing post the Ajax to do a background update of the local listing, it freezes the browser. Here is the code ``` $document->addScriptDeclaration(" jQuery(window).load(function() { checkExternalListing(".$update."); }); function checkExternalListing(id, target, type) { checkExternalListing_server(id, target, type).done(function(result) { // good it is done }); } function checkExternalListing_server(id, target, type) { var getUrl = '".JURI::root()."administrator/index.php?option=com_sermondistributor&task=ajax.autoUpdateLocalListingExternal&format=json'; if(target > 0 && type > 0 && id > 0){ var request = 'token=".JSession::getFormToken()."&target='+target+'&listing='+id+'&type='+type; } return jQuery.ajax({ type: 'GET', url: getUrl, dataType: 'jsonp', data: request, jsonp: 'callback' }); }"); ``` The file that adds the code [../helpers/sermondistributor.php](https://github.com/SermonDistributor/Joomla-3-Component/blob/master/admin/helpers/sermondistributor.php#L46)
Author
Owner

This has been resolved.

This has been resolved.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: christian/Joomla-Sermon-Distributor#26
No description provided.