Why Ionic3 can not trigger document.click()


#1
let a = document.createElement('a');
a.href = 'http://www.google.com';
document.getElementsByTagName('body')[0].appendChild(a);
console.log(a);
a.click();

I use this code to test document.click() event,but a.click() can not trigger in Ionic3
It’s usable in Angular5
why?


#2

what are you trying to do?


#3

I want to navigate to outsite website ,but i can’t use location.href or window.open or window.location.href


#4

If you want to open in new page/tab use => window.open(‘http://www.google.com’, 'blank);
If you want to use the current page/tab use => window.location.href = ‘http://www.google.com’;


#5

i can’t use location.href or window.open or window.location.href
Does anybody can help me?


#6

What you mean you can’t? why?


#7

I use it in special browser, this browser forbidden window.open,window.location.href


#8

what browser you used?


#9

it’s a custom brower used in an app…
emmm…
it’s not the point…