Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Докладніше

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

when clicking on a javacript popup I get an error 404 page not found error message- but the popup works fine in IE.

  • 6 відповідей
  • 3 мають цю проблему
  • 1 перегляд
  • Остання відповідь від neverendingwonder

more options

My website uses a javascript code to open a popup window when someone clicks on a graphic. This works fine in IE, but not in Firefox. Firefox gives an error 404 page not found error in the popup. I have all the options in Firefox set to accept popups, etc.

here is an url to show you what happens-

http://www.welcometoweirdsville.com/vintage.htm

Click on one of the images and you will see what happens.

My website uses a javascript code to open a popup window when someone clicks on a graphic. This works fine in IE, but not in Firefox. Firefox gives an error 404 page not found error in the popup. I have all the options in Firefox set to accept popups, etc. here is an url to show you what happens- http://www.welcometoweirdsville.com/vintage.htm Click on one of the images and you will see what happens.

Усі відповіді (6)

more options

That is a problem with the JavaScript that opens the popup. The script uses href, but for an image that should be src instead. Apparentlt IE doen't care about the missing href and uses the src instead.

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=800,height=400,scrollbars=yes');
return false;
}

This should work:

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href || mylink.src;
window.open(href, windowname, 'width=800,height=400,scrollbars=yes');
return false;
}
more options

Thank you so much for taking the time to reply. However, it didn't work. I added your code and I'm still getting a 404 error code. Here's a test page you can see:

http://www.welcometoweirdsville.com/weirdstuff3.htm

more options

Wait- now it's working! Thanks so much!

more options

If you look at the page source then you will notice thatsomething went wrong with pasting the code and that all white space got removed causing elsehref to become one word: elsehref
So you need to fix the white space in the JavaScript code.


function popup(mylink, windowname){if (! window.focus)return true;var href;if (typeof(mylink) == 'string')href=mylink;
elsehref=mylink.href || mylink.src;
window.open(href, windowname, 'width=800,height=400,scrollbars=yes');return false;}

(I see that you discovered that yourself and have fixed it)

Змінено cor-el

more options

nevermind

Змінено neverendingwonder