4images Forum & Community

General / Allgemeines => Programming => Topic started by: Lakmus on August 29, 2008, 03:40:59 PM

Title: Javascript doesn't work in Internet Explorer,but well works in Firefox and Opera
Post by: Lakmus on August 29, 2008, 03:40:59 PM
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:
Title: Re: Javascript doesn't work in Internet Explorer,but well works in Firefox and Opera
Post by: V@no on August 30, 2008, 01:20:10 AM
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.
Title: Re: Javascript doesn't work in Internet Explorer,but well works in Firefox and Opera
Post by: Lakmus on August 30, 2008, 09:13:10 AM
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/ (http://avatarko.com/)
Title: Re: Javascript doesn't work in Internet Explorer,but well works in Firefox and Opera
Post by: V@no on August 30, 2008, 09:49:10 AM
I don't see that javascript in the source of your page.
Title: Re: Javascript doesn't work in Internet Explorer,but well works in Firefox and Opera
Post by: Lakmus on August 30, 2008, 11:15:19 AM
Excuse, I deleted it, at check. Now it on a place.
Title: Re: Javascript doesn't work in Internet Explorer,but well works in Firefox and Opera
Post by: V@no on August 30, 2008, 06:13:27 PM
It shows fine in IE6, IE7 and IE8...
Title: Re: Javascript doesn't work in Internet Explorer,but well works in Firefox and Opera
Post by: Lakmus on August 30, 2008, 06:24:34 PM
Thanks you, now all work  :D