javascript - How to open in new tab using button -
<script type="text/html" id="marketselection"> <h3 class="choose-store">choose store:</h3> <div class="text-center"> <% _.each(suppliers, function (supplier) { %> <button class="btn-custom supermarket-item" data-id="<%= supplier.id %>"> <i></i><%= supplier.name %> </button> <% }) %> </div> /*file:src/js/data.js*/ var cookie_selectedsupermarket = cookiemanager.retrieve('supplierid'), cookie_selectedpostalcode = cookiemanager.retrieve('deliveryareacode'), cookie_q = cookiemanager.retrieve('q'); data = { availabilitylist: [json_store_availability_list], postalcodes: [json_postal_codes], hardcode: { selected_supermarket: null, selected_postal_code: null, q: null }, query: { selected_supermarket: utils.getqueryparameterbyname('selected_supermarket'), selected_postal_code: utils.getqueryparameterbyname('selected_postal_code'), q: utils.getqueryparameterbyname('q') }, cookie: { selected_supermarket: cookie_selectedsupermarket ? cookie_selectedsupermarket.value : null, selected_postal_code: cookie_selectedpostalcode ? cookie_selectedpostalcode.value : null, q: cookie_q ? cookie_q.value : null }, protocol: 'https://', domain: 'www.test.com.au', path: '/', redirecturi: '/all-products/?supplier=<%= supplierid %><% if (q) { %>&q=<%= q %><% } %>' };
i have issue having buttons open in new tab. in html - know have add in _blank cases this, solution?
thanks
edit: added in more codes it's more clear want.
you can use javascript
function opentab(url) { var win = window.open(url, '_blank'); win.focus(); }
Comments
Post a Comment