Page 1 of 1

javascript with Chrome

Posted: 2019-05-21 17:31
by G Belgrado
batch actions
javascript is perfect with Firefox but does not work with Chrome

Code: Select all

function eseguito(table_name, ids){

	var url = 'eseguito.php?table=' + table_name;
	for(var i = 0; i < ids.length; i++){
		url = url + '&' 
			+ encodeURI('ids[]') + '=' 
			+ encodeURIComponent(ids[i]);
	}
	myWindow = window.open(url, "myWindow", "width=1,height=1");
 myWindow.close();   // Closes the new window
 location.reload(false)
}
is the guilty window.open ??

Re: javascript with Chrome

Posted: 2019-05-22 16:11
by G Belgrado
I found the solution here

viewtopic.php?t=2761#p8613


window.open () was not needed

and with

Code: Select all

function eseguito(table_name, ids){

	var url = 'eseguito.php?table=' + table_name;
	for(var i = 0; i < ids.length; i++){
		url = url + '&' 
			+ encodeURI('ids[]') + '=' 
			+ encodeURIComponent(ids[i]);
	}
	$j.ajax({
    url: url,
    success: function(data){
    }
  })
  location.reload();

}
It's work

Re: javascript with Chrome

Posted: 2019-05-22 16:32
by G Belgrado
but not work on firefox :mrgreen: :mrgreen:

is there a way to start a js depending on the browser detected?

Re: javascript with Chrome

Posted: 2019-05-23 16:47
by G Belgrado
now I have solved
but in another application generated with appgini 5.70
javascript with window.open and .close also works on Chrome.

with appgini 5.75 instead it does not work