Author Topic: Javascript doesn't work in Internet Explorer,but well works in Firefox and Opera  (Read 30287 times)

0 Members and 1 Guest are viewing this topic.

Offline Lakmus

  • Pre-Newbie
  • Posts: 6
    • View Profile
Hello! I have a big  problem with javascript at 4images gallery.

Javascript does not work in Internet Explorer, but well works in Firefox and Opera  :(

Here a script which I use:

<script language="JavaScript" type="text/javascript" src="http://bash.org.ru/forweb">
</script>

I insert this script in header.html

But in internet explorer it does not work, help me to solve this problem please  :oops:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Hello and welcome to 4images forum.

1) this is not related to 4images itself, topic moved to chit chat.
2) other then guess that this script has to be placed inside <body></body> I have no idea why it doesn't work in IE.
Perhaps providing us with more information about what this script supposed to do and link to your site could help find a solution.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Lakmus

  • Pre-Newbie
  • Posts: 6
    • View Profile
I use a template iceberg for 4images, here it's code of header.html
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{site_name}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<link rel="stylesheet" href="{template_url}/images/style.css" />


<script language="javascript" type="text/javascript">

<!--

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
 
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

// -->
</script>

{if has_rss}
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />
{endif has_rss}
</head>
<body>
<div id="container">

I inserted a code inside <head> </head> and as after <body>, but it does not work in IE. As I inserted a code in default  template 4images, but it doesn't work.


This javascript deduces ridiculous citations from a comic site. But a problem not in it's code, because any javascript code which I insert does not work in IE.

Here it's a code of default header.html

Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{direction}">
<head>
<title>{site_name}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<link rel="stylesheet" href="{template_url}/style.css" />
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }


{if has_rss}
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />
{endif has_rss}
</head>
<body bgcolor="#FFFFFF" text="#0F5475" link="#0F5475" vlink="#0F5475" alink="#0F5475">
<br />

I reinstalled 4images, but even in only that established 4images doesn't work javascript in IE.

Link to my site http://avatarko.com/

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
I don't see that javascript in the source of your page.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Lakmus

  • Pre-Newbie
  • Posts: 6
    • View Profile
Excuse, I deleted it, at check. Now it on a place.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
It shows fine in IE6, IE7 and IE8...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Lakmus

  • Pre-Newbie
  • Posts: 6
    • View Profile
Thanks you, now all work  :D