Solved

javascript causing apache to crash?!?

Posted on 2004-04-01
2
293 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:johndoeherty
2 Comments
 
LVL 6

Author Comment

by:johndoeherty
Comment Utility
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
Comment Utility
Closed, 500 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now