WordPress.org

Forums

[resolved] user login problem (2 posts)

  1. blackfrog
    Member
    Posted 4 years ago #

    Hey everyone,

    I am currently developing a website for a friend and have recently run into a bug I cannot figure out. Whenever a user opens the post page without logging in, the page runs fine. When that same user logs in and opens the page, the code below stops working.

    document.getElementById('prc').innerHTML= currentPricetxt + currentPrice;
    document.getElementById('txt').innerHTML= timeText + checkTime(daysDifference ) + ":" + checkTime(hoursDifference ) + ":" + checkTime(minutesDifference )+ ":" + checkTime(secondsDifference );
    }else{
    document.getElementById('txt').innerHTML="This job has expired";
    }
    t=setTimeout('startTime()',500);
    }
    //Else if the job has been accepted
    else{
    currentPricetxt = "Accepted Price: $";
    currentPricetxt = currentPricetxt.bold();
    currentPrice = "<?php echo $price; ?>";
    userAccepttxt = "Job accepted by: ";
    userAccepttxt = userAccepttxt.bold();
    employeeID = "<?php echo $employee_name; ?>";
    timeText = "Bidding has ended";
    document.getElementById('prc').innerHTML= currentPricetxt + currentPrice;
    document.getElementById('txt').innerHTML= timeText;
    }
    }
    
    </script>
    </head>
    
    <body onload="startTime()">
    <br>
    <div id="prc"></div>
    <div id="usr"></div>
    <div id="txt"></div>
    <br>
    </body>

    Any help is appreciated. Thanks

  2. blackfrog
    Member
    Posted 4 years ago #

    I figured out what the problem is if anybody has the same issues. I called window.onload first in the sidebar, then in the post section. Only the first call gets used i guess

Topic Closed

This topic has been closed to new replies.

About this Topic