LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-08-2007, 08:02 PM   #1
ToothlessRebel
Member
 
Registered: Jun 2004
Location: FL, USA
Distribution: Slackware 9.1
Posts: 190

Rep: Reputation: 30
Apache2 showing Javascript code?


What am I missing that my javascript shows in the browser instead of ... working?

Code:
<script language="javascript"><!--
function SimpleSwap(el,which){
  el.src=el.getAttribute(which || "origsrc");
}

function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;

    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
   x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}

var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}
 -->
 
Old 04-08-2007, 09:49 PM   #2
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
your forget </script>
 
Old 04-09-2007, 12:20 PM   #3
ToothlessRebel
Member
 
Registered: Jun 2004
Location: FL, USA
Distribution: Slackware 9.1
Posts: 190

Original Poster
Rep: Reputation: 30
Oh... well then...

I feel like a moron, thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
insert JavaScript code from server mavgh1 Linux - General 3 03-29-2006 12:57 AM
Have installed PHP for Apache2 but source code showing Tomo3000 SUSE / openSUSE 4 08-04-2005 07:14 PM
Javascript code, what do you think? swatward General 2 05-18-2005 09:43 AM
Javascript Code doesnt work w/ firefox? swatward Programming 1 04-18-2005 06:54 PM
Apache2: showing password protected directories hamish Linux - Software 7 11-15-2004 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration