/    Sign up×
Community /Pin to ProfileBookmark

Refresh pop-up with new content

Hi,
It it stands the coding refreshes a pop-up window bringing it to the front with the SAME content.

However, I wish to click on a DIFFERENT link that refreshes the same pop-up window but with the NEW content. This means it is always the same pop-up window open regardless of the content.

Can anyone help? The existing code is below.

Thanks in advance.

<script>
<!–
var gmyWin=null;

function myOpenWindow(winURL, winName, winFeatures, winObj)
{
var theWin;

if (winObj != null) {
if (!winObj.closed) {
winObj.focus();
return winObj;
}
}

theWin = window.open(winURL, winName, winFeatures);
return theWin;
}

//–>
</script>
<table class=”tracking”>
<tbody>
<tr>
<td>No</td>
<td>Description</td>
<td>Created</td>
<td>Status</td>
</tr>
<tr>
<td><div style=”enquiry-detail”><a href=’javascript:;’ onClick=’javascript:gmyWin=myOpenWindow(“enquiry-1.html”,”myWin”,”height=600,width=600″,gmyWin);return false’>123456</a></div></td>
<td>Brief description</td>
<td>14-1-15</td>
<td>Closed</td>
</tr>
<tr>
<td><div style=”enquiry-detail”><a href=’javascript:;’ onClick=’javascript:gmyWin=myOpenWindow(“enquiry-2.html”,”myWin”,”height=600,width=600″,gmyWin);return false’>123457</a></div></td>
<td>Brief description</td>
<td>14-1-15</td>
<td>Closed</td>
</tr>
</tbody>
</table>

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Kevin2May 04.2015 — Try this:
[code=html]<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Popup script</title>
<script>
function open_window(url){
mywin = window.open(url,'wins','width=600,height=600,scrollbars')
}
</script>
</head>
<body>
<table class="tracking">
<tbody>
<tr>
<td>No</td>
<td>Description</td>
<td>Created</td>
<td>Status</td>
</tr>
<tr>
<td><div style="enquiry-detail"><a href="javascript:open_window('enquiry-1.html')">123456</a></div></td>
<td>Brief description</td>
<td>14-1-15</td>
<td>Closed</td>
</tr>
<tr>
<td><div style="enquiry-detail"><a href="javascript:open_window('enquiry-2.html')">123457</a></div></td>
<td>Brief description</td>
<td>14-1-15</td>
<td>Closed</td>
</tr>
</tbody>
</table>
</body>
</html>[/code]
Copy linkTweet thisAlerts:
@techgraphicsauthorMay 04.2015 — Thanks for the reply Kevin.

This was the original coding I had which works brilliantly in Chrome and Safari, but not in Firefox and IE (which my client uses so is important). I then updated the code so the pop-up window would refresh 'in front'. Then of course it would not change the content, as a result I have coding for each but not combined.

If the code you suggested would always bring the pop-up to the front when refreshing in Firefox and especially IE, my problem would be solved.
Copy linkTweet thisAlerts:
@Kevin2May 04.2015 — If the code you suggested would always bring the pop-up to the front when refreshing in Firefox and especially IE, my problem would be solved.[/QUOTE]

Change the script I posted above to:
&lt;script&gt;
function open_window(url){
mywin = window.open(url,'wins','width=600,height=600,scrollbars');
mywin.focus();
}
&lt;/script&gt;


That should bring the popup to the front.
Copy linkTweet thisAlerts:
@techgraphicsauthorMay 04.2015 — Brilliant! Thank you. I can face my client tomorrow with problem solved.
×

Success!

Help @techgraphics spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...