Reputation: 261
<script type="text/html" id="marketSelection">
<h3 class="choose-store">Choose your 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 an issue having the buttons open in new tab. In HTML - I know we have to add in _blank but for cases like this, what is the solution?
Thanks
EDIT: Added in more codes so that it's more clear what I want.
Upvotes: 0
Views: 84
Reputation: 537
You can use Javascript
function openTab(url) {
var win = window.open(url, '_blank');
win.focus();
}
Upvotes: 1