Work fine in FF but half-way with IE ???

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Peuplarchie
Forum Contributor
Posts: 148
Joined: Sat Feb 04, 2006 10:49 pm

Work fine in FF but half-way with IE ???

Post by Peuplarchie »

Good day,
The code below is working fine in FF but when I try it in IE, it generate everything but when I change the image with the drop down box it don't change the image as supposed with javascript function.

Do somebody see something wrong in my code ?


Code: Select all

<td width="200" valign="top" align="left" class="black">
<script language="JavaScript" type="text/javascript" >
function changePic(fe){
var opt_key = fe.selectedIndex;
var fileName = fe.options[opt_key].value;
document.noimage.src=fileName;
return true;
}
</script>
<br>
Image :<br>
<center><select name="image" onchange="changePic(this);">
  <option>[Choisir une image]</option>
<?php

   function recur_dir($dir)
   {
       $dirlist = opendir($dir);
       while ($file = readdir ($dirlist))
       {
           if ($file != '.' && $file != '..')
           {
               $newpath = $dir.'/'.$file;
               $level = explode('/',$newpath);
               if (is_dir($newpath))
               {
                   $mod_array[] = array(
                           'level'=>count($level)-1,
                           'path'=>$newpath,
                           'name'=>end($level),
                           'kind'=>'dir',
                           'mod_time'=>filemtime($newpath),
                           'content'=>recur_dir($newpath));
			echo '<OPTION>'.$newpath.'</option>';
               }else{
  
                   $mod_array[] = array(
                           'level'=>count($level)-1,
                           'path'=>$newpath,
                           'name'=>end($level),
                           'kind'=>'file',
                           'mod_time'=>filemtime($newpath),
                           'size'=>filesize($newpath));
			echo '<OPTION value='.$newpath.'>'.$newpath.'</option>';
              }
           }
       }
       closedir($dirlist);
       return $mod_array;
   }
   
   print_r(recur_dir('Images'));
echo '</select></center>';


?>
<br>
<center><img src="peuplies-1-man-small.bmp" width="100"  id="noimage" align="center"></center>
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You'll have to be more clear about *where* the error is occurring.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Client-Side.

This is your 3rd duplicate thread.. please make it your last or we will be forced to enforce the rules.
UrButtFullOfArr0ws
Forum Commoner
Posts: 64
Joined: Wed Feb 21, 2007 11:42 am
Location: Up a tree >.>"

Post by UrButtFullOfArr0ws »

<td width="200" valign="top" align="left" class="black">
<script language="JavaScript" type="text/javascript" >
:? Aren't scripts such as javascript supposed to go in the <head> element and table in the <body> element?

Edit @ gente: Yeah i saw that just a bit earlier where a script wouldnt allow me to put it in head but instead had to put it in body. But does this means that tables are also allowed in <head>? :)
Last edited by UrButtFullOfArr0ws on Thu Jul 19, 2007 7:09 am, edited 1 time in total.
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

UrButtFullOfArr0ws wrote:
<td width="200" valign="top" align="left" class="black">
<script language="JavaScript" type="text/javascript" >
:? Aren't scripts such as javascript supposed to go in the <head> element and table in the <body> element?
Aren't.
User avatar
Peuplarchie
Forum Contributor
Posts: 148
Joined: Sat Feb 04, 2006 10:49 pm

Post by Peuplarchie »

Jcart wrote:Moved to Client-Side.

This is your 3rd duplicate thread.. please make it your last or we will be forced to enforce the rules.
same code, different questions.
Post Reply