Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nermal

Moderator
Original poster
Staff member
Dec 7, 2002
20,651
4,053
New Zealand
I have a web app where users can upload listings, and I'm popping up a message asking whether they want to add photos.

function askAddPhotos(id)
{
addPhotos = confirm('Add photos now?');
if(addPhotos == true) { showPhotos(id); }
}

function showPhotos(id)
{
photoviewer = open("PhotoViewer.aspx?ID=" + id, "PhotoWindow", "width=615 etc");
}

This works in IE (with the popup blocker enabled), but Safari's blocker catches it and prevents the popup from opening. Is there a way to "code around" this problem? Or should I be taking a different approach?

By the way, I'm quite new at JS, so be sure to spell everything out :eek:

Thanks :)
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
Have you thought of maybe using a hidden <div> instead that you can pop over the content if need be? As a usability issue, what you describe sounds more like an optional task so forcing the user to click through a pop-up may not be the best approach.

Can you get away with just alerting them with a static link/graphic/button that it's an option?
 

Nermal

Moderator
Original poster
Staff member
Dec 7, 2002
20,651
4,053
New Zealand
Oops, I meant to reply to this thread and say that I'd sorted it out. I ended up doing exactly what you suggested, I used a <div> :)
 

Nermal

Moderator
Original poster
Staff member
Dec 7, 2002
20,651
4,053
New Zealand
Heh, yeah, I didn't really like having the "forced" JavaScript box - it was a "quick fix". Good to get rid of it :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.