I'm building a site (the child) that displays detailed information about all vehicles from a region. The region has an id (Rid) and also the vehicle (Vid).
In the parent tab, the user selects a region and clicks on the button that opens the child tab with the selected Rid (send by cookies).
<a class="btn btn-default btn-xs" href="/TStatus" target="_blank">
In the child tab, the user can change the region to see other information and when he click on a Vehicle name the region id should be send by cookie back to the parent tab.
function ToParentTab(id) {
var childHref = window.location.host;
var parentwindow = myOpenWindow(window.location.protocol + "//" + childHref + "/main", ParentPage", "", window.location.protocol + "//" + childHref + "/main");
}
function myOpenWindow(winURL, winName, winFeatures, winObj) {
var theWin;
if (winObj != null) {
if (!winObj.closed) {
setCookie("teksid", regionId, 365);
window.opener.parent.focus();
}
}
setCookie("teksid", regionId, 365);
theWin = window.open(winURL, winName, winFeatures);
return theWin;
}
Is there a way so that when clicking on the vehicle from child tab the parent page will be focused (if closed open it again) and also call a function that will refresh the content according to the received cookie without loading again the entire page?