Closed

Javascript debug

I have a large javascript function init() that hides and shows a large number of div's. When the page is loaded the javascript function is triggered by the script below.

<script type="text/javascript">

$(document).ready(function() {

init();

});

</script>

Most of the time the javascript is triggered by the script below. However once in a while the script init() seems not to be triggered. Approximately 1 of 20 times the function init() seems not to be triggered. All the other 19 times the page and javascript is working fine without any errors. The circumstances when this error occurs seem to be no different from normally as this error occurs when Pressing F5 20 times.

I checked that init() seems to not being called at all because the first statement (alert("function called");) in init() wasn't called. In the cases that the javascript was working fine I got the alert message and the page was loaded fine without any errors.

I tried different ways to trigger the javascript such as [login to view URL] and putting at the end of the page this script:

<script type="text/javascript">init();</script>

All those different methods to trigger init() didn't seem to make any difference.

This is the init() function:

function init(){

pauzereload__gl_var=1;

load2__gl_var=0;

//Hide bus options:

var boxbusnotshow = [login to view URL]("boxDiv").getElementsByTagName("a");

boxbusnotshow[3].style.display="none";

boxbusnotshow[4].style.display="none";

boxbusnotshow[5].style.display="none";

[login to view URL]("loadingdiv").[login to view URL] = "none";

[login to view URL]("loadingdivdate").[login to view URL] = "none";

getvariables(); //Get variables generated by the php script, to get activetab

var a=1; b=1;

highlightboxinitiate(a,activetab__gl_var,load2__gl_var);

highlightlistinitiate(a,b);

pauzereload__gl_var=0;

}

The functions called from this function are attached.

Please bid on this project if you are sure you can debug this problem.

Skills: Javascript

See more: statement problem, php debug, debug, time triggered, javascript time difference, text javascript, hide div javascript, trigger javascript, ready javascript, javascript text, javascript document ready, document ready javascript, hide javascript hide, script alert script, pressing document, bus script php, javascript ready, large php script working, javascript page hide, javascript problem

About the Employer:
( 70 reviews ) Goes, Netherlands

Project ID: #1552353

4 freelancers are bidding on average $48 for this job

HeNet

Hello I am interested in your project. Please check pm. Thanks.

$50 USD in 1 day
(235 Reviews)
7.1
khanhhuyna

I'm a javascript developer and I'm happy to help you to solve this bug. Thanks.

$80 USD in 1 day
(69 Reviews)
6.0
Alfateck

Hi. I could not see any error on those functions.... I will need to check the page and add debug alerts everywhere...

$30 USD in 10 days
(14 Reviews)
4.5
sadishkannan

i have very simple solution to resolve this issue. You can try on your own. Please do mail me or reply me to resolve this issue.

$30 USD in 1 day
(0 Reviews)
0.0