How to open javascript items array in a new window instead of the same window? -


i have great working code opens link in same window when click it, it's inside dropdown menu.

this in javascript.

problem open in new tab instead of same window. how can this?

here code:

items["linkeee"] = {     "label": "mylabel",     "action": function(obj) {         openurl('http://mypageaa.com/page' + addid);     } }; 

update -- html looks this:

<a href="#">mylabel</a> 

but don't have direct access html without messing stuff up. gotta there javascript

update

how combine 'http://mypageaa.com/page' + addid add , "_blank"

please thanks

turn off pop-up blockers domain @ browser preferences or settings, see chrome pop-up blocker when re-check after allowing page. use window.open()

var w; items["linkeee"] = {     "label": "mylabel",     "action": function(obj) {         w = window.open("http://mypageaa.com/page", "_blank");     } }; 

alternatively, use <a> element @ html target attribute set "_blank"

<a href="http://mypageaa.com/page" target="_blank">mypageeaa</a> 

using javascript

var = document.createelement("a"); a.href = "http://mypageaa.com/pagee" + addid; // `encodeuricomponent(addid)` a.target = "_blank"; document.body.appendchild(a); a.click(); 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -