Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IE7 behavior: url memory leak?

    Hi all,

    There seems to be a lot going on with my particular problem. I hope I have this thread in the correct place. I will do my best to explain as it is even a bit confusing with me.

    Background -
    index.html
    - Loads styles.css
    - includes SecurIndex.php
    - contains js function getCal

    SecurIndex.php
    - uses JS/XML get.document function (getCal) to load Calender.php into div cal1

    Calender.php
    - creates links for persons on call each day
    - :hover on each name gives their contact info
    - the hover box is a formated div
    - there are generated links to go ahead one month or back by calling getCal()

    styles.css
    - uses the following IE fix:
    - behavior: url('/TOCCalendar/IEFixes.htc');
    - #infobox.hover div

    So that is the basic setup on how things work. Now here is the problem. Everything works fine in Firefox, Opera, IE6. This brings us to IE7. Everything works just fine until the link to go forward or back a month is clicked. Suddenly CPU hits 90% and hangs as such for about 10 min. Using process explorer I found that a rather large number of ntdll.dll!RtlAllocateHeap+0x18c are being called, and IEFRAME.dll is hitting the high CPU. Did a lot of testing and found the problem relates to the behavior: call in my css file. I comment it out and the problem goes away, however the happy hovering div with contact info goes away. Still works in Firefox of course.

    It was my understanding that the :hover pseudo class should be compliant in IE7, so should it not be the case that with behavior: and #infobox.hover div commented out (just leaving #infobox:hover div) it should work? And if not has anyone ever seen something like this happen, or know how I might use :hover in a compliant way for IE6, IE7 and the rest?

    I can post any code that might help, but did not want to clutter this initial post with unneeded information.

    Any help would be greatly appreciated,
    Matt
    Last edited by windago; 12-11-2006 at 06:03 PM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    IE7 doesn't need the behavior as many bugs were fixed what you should do is something like this
    Code:
    <!--[if lte IE 6]>
    <style type="text/css">
    body {
    behavior:url(hover.htc);
    }
    </style>
    <![endif]-->
    The above goes AFTER your linked stylesheet NOT in it. Once you do that remove the behavior call from your main stylesheet.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the info. That will solve the problem of keeping IE6 working once I correct IE7. The problem is, when I take the behavior call out of my css IE7 stops displaying the hover also. So I am not entirely sure why it is not behaving like it should be.

    Thanks!
    Matt

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Can you post the rest of your code or give us a link? IE7 will work as expected only when it has a full valid doctype.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Jun 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    #####################EDIT##############################

    Thanks _Aerospace_Eng_ you where right on the money. Once I pulled my head out of my fanny and woke up I was able to fix it.

    I echo'd out the DOCTYPE call listed below in my index.php and boom problem fixed!! I have never really had to mess with using DOCTYPE in the stuff that I have done. Going forward that is some good stuff to know and I will need to read up more on it as I try to bring the age old code that was written in this place up to standard.

    Thanks again!!!
    Matt

    ####################################################333




    I can't post a link as the site is internal at work. Checking the component pages I noticed a doctype was never set as you suggested. Should it be something like:

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    I would place that at the top of my index.php correct? Doing so I would not need to set it in each of the component parts pulled in correct? Below is the bits of the code I am using. I have not implement the first suggestion yet. Want to get IE7 working first hee hee.

    *****EDIT**** just realized that I would do that in html documents. What method would I use in a php? *******

    styles3.css
    Code:
    #infobox
    {
            behavior: url('/TOCCalendar/IEFixes.htc');
    }
    
    #infobox div
    {
            display: none;
            width: 150px;
            text-decoration: none;
            position: absolute;
            border: inset #000 1px;
            background: #fff;
            margin: 0px 0px 0px 0px;
            padding-left: 3px;
            color: black;
            font-weight: lighter;
    }
    
    /***For Firefox***/
    #infobox:hover div
    {
            display: block;
            text-decoration: none;
            margin-left: 25px;
    }
    
    /*****For IE*****/
    #infobox.hover div
    {
            display: block;
            text-decoration: none;
    }
    IEFixes.htc
    Code:
    <PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="DoHover()" />
    <PUBLIC:ATTACH EVENT="onmouseout"  ONEVENT="RestoreHover()" />
    <SCRIPT LANGUAGE="JavaScript">
    function DoHover()
    {
                element.className += ' hover';
    }
    
    function RestoreHover()
    {
                element.className = element.className.replace(/\bhover\b/,'');
    }
    </SCRIPT>
    index.php
    Code:
    <LINK REL=STYLESHEET TYPE="text/css" HREF="styles3.css">
    Thank you sooo much for your help!!!
    Matt
    Last edited by windago; 12-12-2006 at 03:31 PM. Reason: fixed

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    php is html once its parsed. From the looks of things though you are using XHTML. Try using this doctype instead.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    Remember nothing can go above the doctype or it will cause IE6 to not work properly as well.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •