Thread: DHTML with php

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    6
    Rep Power
    0

    DHTML with php


    I'm trying to put together a site design for an ezPublish site where I'm using a floating menu based on layers and JS. The problem that I've been experiencing is that certain page loads hang to the point of timing out. If I remove the floating layer and it's content (doesn't matter what it happens to be) the page loads fine.

    I'm looking for any suggestions as to why the two don't want to work together. It would seem there should be no conflict as one is server side and the other is client side, but....

    Thanks.
    RWW
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2001
    Posts
    765
    Rep Power
    13
    Could be Al-Queda.

    Might not, but hard to tell from that brief description...
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    24
    If it's hnging and it's not a bug in the software being used then it's probably a while or for loop that is never ending.

    The pretty useless post by mrrichardwhatever was because you didn't post any code,s owe don't have any grounds to work out what's wrong. Of course, if he had have just said that instead of trying to be funny then:

    a) You may have rectified the problem sooner and,
    b) We wouldn't have realised that his jokes aren't very funny. In fact, 'very' shouldn't be in there.

    Post some code please...
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    6
    Rep Power
    0
    I would have posted some code, but I'm not knowledgeable enough about php to figure out which of the scripts are being called. (ezPublish is a very large content management system).

    I was hoping to find someone who had had similar experience with DHTML interfering with PHP running properly, since I don't think there's a problem with the PHP itself, as everything runs fine if I remove the layer divisions that handle the floating menu.

    Even with no php tags inside the layer, the page hangs when certain calls are made. Are there any way that the way the Javascript calls might be misinterpreted as php calls even though they're not enclosed in php tags?

    Thanks for your offer of help, but I don't think I could post sufficient code to illuminate the problem.

    Thanks.
    RWW
  8. #5
  9. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    24
    It's pretty much impossible to say where the error can lie, but javascript and php will not intefere with one another unless you were running server-side javascript (and you'r know if you were).

    You said that it works if you remove the floating layer. Does PHP create the floating layer, if so then does it use any looping? This could be the culprit. Have you tried doing the floating layer with static content as a test? If it works then you'll know that it's not the javascript causing the page to hang.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    6
    Rep Power
    0
    Following is the part of the page that seems to be causing the problem. Obviously, I can't post the whole script, but the three layers are described in the head of the document using CSS.

    <div id="floatLayer2">
    <div id="menuLayer">

    <?
    $CategoryID = 0;
    include( "ezarticle/user/menubox.php" );
    ?>

    <?
    $CategoryID = 1;
    include( "ezarticle/user/headlines.php" );
    ?>

    <?
    include( "ezlink/user/menubox.php" );
    ?>

    <?
    // include the static pages for category 2
    $CategoryID = 1;
    include( "ezarticle/user/articlelinks.php" );
    ?>
    </div>

    <div id="closerLayer"><a href="javascript:;" onMouseOver="P7_autoLayers(0,'floatLayer2')"><img src="<? print $GlobalSiteIni->WWWDir; ?>/sitedesign/<? print ($GlobalSiteDesign); ?>/images/Clear.gif" width="155" height="465" name="closerImage" border="0"></a></div>

    <a href="javascript:;" onMouseOver="P7_autoLayers(0,'floatLayer2','menuLayer','closerLayer')"><img src="<? print $GlobalSiteIni->WWWDir; ?>/sitedesign/<? print ($GlobalSiteDesign); ?>/images/dropperLine.gif" width="10" height="100" border="0"></a>

    </div>

    It makes no difference if the content of the menuLayer is static, there are still problems. Even if I strip it down to:

    <div id="floatLayer2">
    <div id="menuLayer"></div>
    <div id="closerLayer"></div>
    </div>

    ... the page won't load. The browser window flickers and the status bar indicates it's downloading "items", but it normally stalls and gives a timed out message after 60 seconds. A refresh then brings up the page, probably because new info has been stored in the cache files that the script uses.

    Removing everything, however, makes the page work fine.

    Any more thoughts would be appreciated, though I know the information is sketchy at best.

    Thanks.
    RWW
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2001
    Posts
    765
    Rep Power
    13
    rwwood -

    Don't mind blinky; he's just our local twit. Since his programming skills are minimal, he boosts his little ego by commenting on others' posts - as if he were a mod here (he's not; they don't give that assignment to people without discernable skills). He does make cute logos, however, a new one every day....

    Sounds like your diagnostics are on track. If the bare <div> elements are still reproducing the problem, there might be something in the accompanying CSS that is causing problems, since you've already reduced the markup down to a generic level.
    Could you post the related style sheet? Anything would help...
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    6
    Rep Power
    0
    The style sheet is linked in the header with:

    <link rel="stylesheet" type="text/css" href="<? print $GlobalSiteIni->WWWDir; ?>/sitedesign/<? print ($GlobalSiteDesign); ?>/styles/slider.css" />

    ... and the sheet itself contains the following for the layers in question:

    #closerLayer { position: absolute; width: 155px; height: 465px; z-index: 104; left: 0px; top: -10px; visibility: hidden}
    #floatLayer2 { position:absolute; height:127px; width:140px; left:0px; top:10px; z-index:100}
    #menuLayer { position:absolute; z-index:105; background-color: #DADCF1; layer-background-color: #DADCF1; left: 0; top: 0; visibility: hidden}

    I tried deleting the lines from the style sheet to see what would happen, and other than being improperly displayed, the result was the same. Clicking on the links that produced the hang, still do. :-/

    Thanks again for your help.
    RWW

IMN logo majestic logo threadwatch logo seochat tools logo