Solved

javascript causing apache to crash?!?

Posted on 2004-04-01
2
297 Views
Last Modified: 2010-03-04
Hi all,
i'm running Apache/2.0.47 (Win32) mod_perl/1.99_10-dev Perl/v5.8.0 mod_ssl/2.0.47 OpenSSL/0.9.7b PHP/4.3.3
on an xp pro machine.
i added a javascript to randomly pick and display certain banner images.
now i get strange behavior in that after 2-3 reloads or clicks to other pages apache dies writing the following into error.log:

[Thu Apr 01 14:49:47 2004] [notice] Parent: child process exited with status 4294967295 -- Restarting.
[Thu Apr 01 14:49:51 2004] [notice] Parent: Created child process 1664
[Thu Apr 01 14:50:25 2004] [notice] Child 1664: Child process is running
[Thu Apr 01 14:50:25 2004] [notice] Child 1664: Acquired the start mutex.
[Thu Apr 01 14:50:25 2004] [notice] Child 1664: Starting 250 worker threads.

i've looked into bug reports (http://bugs.php.net/bug.php?id=25570) but that didn't really help me any.
here's the script that causes the prob :

      path = 'pics/banner/'
      num1 = Math.round(Math.random() * 8);
      num2 = Math.round(Math.random() * 8);
      if(num1 == num2)
            num2++
      banner_pics = new Array()
      banner_pics[0] = 'banner_1.gif'
      banner_pics[1] = 'banner_2.gif'
      banner_pics[2] = 'banner_3.gif'
      banner_link = new Array()
      banner_link[0] = 'http://www.bla.com'
      banner_link[1] = 'local_file.html'
      banner_link[2] = 'another_local_file.php'

      banner2 = document.getElementById('banner_2') // img tag with id='banner_2'
      banner3 = document.getElementById('banner_3') // dito

      b2_link = document.getElementById('b_2_link') // a tag with id = 'b_2_link'
      b3_link = document.getElementById('b_3_link') // dito
      
      banner2.src = path+banner_pics[num1]
      banner3.src = path+banner_pics[num2]
      switch(num1) {
            case 0:
            case 2:
                  b2_link.target = '_new'
                  break;
      }
      
      switch(num2) {
            case 0:
            case 2:
                  b3_link.target = '_new'
                  break;
      }

      b2_link.href = banner_link[num1]
      b3_link.href = banner_link[num2]

would greatly appreciate any help!
thnx
J
0
Comment
Question by:Mike D
2 Comments
 
LVL 6

Author Comment

by:Mike D
ID: 10731997
ups!
guess i solved it myself... ;-}

took the src= and href= out of the elements and now it works ok!

hope this helps anybody having similar problems.
would still like to know what was going on though...
0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
ID: 10734146
Closed, 500 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question