Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can popup and alert co-exist?

Status
Not open for further replies.

RenoWV

Technical User
Mar 16, 2002
156
US

Is there a way to incorporate this line:

onclick='alert("There are a number of slides in our presentation, so please allow a few moments for the images to load")'

into this code:

Enjoy our <a onclick=&quot;return openInfo('HTML/slideshow.html');topWindow()&quot;; href=&quot;slideshow.html&quot;>Slideshow</a>

What we have here is this: When the &quot;Slideshow&quot; link is clicked, a popup window loads which contains a slideshow script.

If I do this configuration:

onclick='alert(&quot;There are a number of slides in our presentation, so please allow a few moments for the images to load&quot;)';&quot;return openInfo('HTML/slideshow.html');topWindow()&quot;;

then the alert does comes up, however when the alert box is dismissed, the slide show loads into the parent window, rather than the popup.

If I do this:

onclick=&quot;return openInfo('HTML/slideshow.html');topWindow()&quot;;'alert(&quot;There are a number of slides in our presentation, so please allow a few moments for the images to load&quot;)';

Then I get the popup fine, but no alert at all. What we'd like to have is first the alert, then the popup.

I suppose that it is likely a case of choosing one or the other, but wanted to check for some authoritative opinions...



 
Can you put the alert in the slideshow.html page? If you put it in like this, it'll run before the page finishes loading - as far as I know (could be wrong!)...

Code:
<head>
<script language=javascript>
  alert(&quot;blah blah blah&quot;);
</script>
</head>
Hope this helps,
Jessica
 
for example?

<html>
<head>
<title>Enter the title of your HTML document here</title>
<script language=&quot;javascript&quot;>
<!--
function openPippo(){
window.open('Pippo.html');
}
-->
</script>
</head>
<body>
<p>
<input type=&quot;button&quot; onclick=&quot;alert('Ciao');return openPippo()&quot; value=&quot;go&quot;/>
</p>
</body>
</html>
 
Thanks very much Jessica & cedivad. I went ahead and put the alert in the simple js in the head, as you suggested Jessica, and it works exactly the way I had hoped.

Those of us who don't write javascript really appreciate this resource - thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top