jQuery: The Write Less, Do More JavaScript Library

Refresh DIV seems to cause memory leak problem in IE

View: New views
6 Messages — Rating Filter:   Alert me  

Refresh DIV seems to cause memory leak problem in IE

by NEIGHCOMPS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have this code to refesh a DIV on my pages but if Internet Explorer
is left running all day, it eats up all available memory to the point
where the computer hangs.

This is the code:

var refreshId = setInterval(function() {
     $('#footerBar').load('liveTasksFeed.php');
}, 5000);


This is the DIV code:

<div id="footerBar">Loading...</div>


Basicaly the contents of liveTasksFeed.php replaces the Loading....
message after 5 seconds and the liveTasksFeed.php has a recordset
query which checks for any records that have a date and time of NOW()
to enable the task funcioanlity.

On the liveTasksFeed.php I have the following jQuery elements:

<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-
ui-1.7.2.custom.min.js"></script>
<link href="css/ui-lightness/jquery-ui-1.7.2.custom.css"
rel="stylesheet" type="text/css" />


<?php if ($totalRows_rsTasks > 0) { // Show if recordset not empty ?>
Logged in as: <strong>Lee Bridgewater</strong> ( Total tasks which are
currently open to you <strong>0 </strong>)
<a href="logOut.php">Log Out</a>
<script type="text/javascript">
        $(document).ready(function() {
                $("#dialog").dialog({
                        bgiframe: true,
                        height: 450,
                        modal: true
                });
        });
        </script>


Is this the correct way to implement this?

Basicaly all I want to do is display a mocal dialog box on the page
whenever a record is called matching the current date/time.

Any help appreciated.

Thanks

Lee

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: Refresh DIV seems to cause memory leak problem in IE

by Fontzter-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Lee,

One option would be to create the dialog and autoHide it when the main
page loads.  Then do your refresh code at the intervals to check for
the record.  I would do this check with ajax and, if a new record is
found, take the data (json, xml, or even html), add it to the dialog
and then open the dialog.  I find it's much easier to just pass the
data on your calls rather than DOM elements and script code.  It's
cleaner, less to pass and keeps code centralized.  (Using json seems
to make this much faster too.)  I'm not sure if this is leading to
your leak problem or not, but just offer it as a suggested approach.

Hth,

Dave


On Nov 3, 11:25 am, NEIGHCOMPS <leebridgewa...@...> wrote:

> I have this code to refesh a DIV on my pages but if Internet Explorer
> is left running all day, it eats up all available memory to the point
> where the computer hangs.
>
> This is the code:
>
> var refreshId = setInterval(function() {
>      $('#footerBar').load('liveTasksFeed.php');
>
> }, 5000);
>
> This is the DIV code:
>
> <div id="footerBar">Loading...</div>
>
> Basicaly the contents of liveTasksFeed.php replaces the Loading....
> message after 5 seconds and the liveTasksFeed.php has a recordset
> query which checks for any records that have a date and time of NOW()
> to enable the task funcioanlity.
>
> On the liveTasksFeed.php I have the following jQuery elements:
>
> <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
> <script type="text/javascript" src="js/jquery-
> ui-1.7.2.custom.min.js"></script>
> <link href="css/ui-lightness/jquery-ui-1.7.2.custom.css"
> rel="stylesheet" type="text/css" />
>
> <?php if ($totalRows_rsTasks > 0) { // Show if recordset not empty ?>
> Logged in as: <strong>Lee Bridgewater</strong> ( Total tasks which are
> currently open to you <strong>0 </strong>)
> <a href="logOut.php">Log Out</a>
> <script type="text/javascript">
>         $(document).ready(function() {
>                 $("#dialog").dialog({
>                         bgiframe: true,
>                         height: 450,
>                         modal: true
>                 });
>         });
>         </script>
>
> Is this the correct way to implement this?
>
> Basicaly all I want to do is display a mocal dialog box on the page
> whenever a record is called matching the current date/time.
>
> Any help appreciated.
>
> Thanks
>
> Lee

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: Re: Refresh DIV seems to cause memory leak problem in IE

by Kristiono Setyadi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, unfortunately, you're right. I always try to transfer *only* the data
and not the presentation. I also use several type of data to transfer in AJAX.
JSON is the fastest among XML and HTML (HTML is a big heavy mom
to transfer using AJAX).

When some cases allow you to transfer *only* the data via AJAX, use it. Don't spent your resource
for the DOM element that must be sent via AJAX. It's a headache, I think.

Thank you very much.


Kristiono Setyadi

Web Programmer and Developer
Citraweb Nusa Infomedia
http://citra.web.id/

http://kristiono-setyadi.net/

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.

Re: Refresh DIV seems to cause memory leak problem in IE

by NEIGHCOMPS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dave,

Thank you for your feedback.

I am not sure how I would achieve what you mentioned as I am very new
to JQuery etc.

I'm sure if you know what you are doing it is a farely simple piece of
code but I just dont have the expertise.

I would be more than happy to pay yourself or someone to write the
code I need as I am going round in circles trying to get it to work as
it is!!

I can email you or anyone who can assist from my work address if you
would be willing to help out?

Many thanks

Lee

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: Refresh DIV seems to cause memory leak problem in IE

by Fontzter-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Lee,

Thanks for the offer, however I am not in a place to accept right
now.  As you mentioned, this is a common practice and I'm sure there
are others who could help out.  Ideally you would want someone who
works in php as well, which I do not.

Good luck,

Dave


On Nov 4, 4:15 am, NEIGHCOMPS <leebridgewa...@...> wrote:

> Hi Dave,
>
> Thank you for your feedback.
>
> I am not sure how I would achieve what you mentioned as I am very new
> to JQuery etc.
>
> I'm sure if you know what you are doing it is a farely simple piece of
> code but I just dont have the expertise.
>
> I would be more than happy to pay yourself or someone to write the
> code I need as I am going round in circles trying to get it to work as
> it is!!
>
> I can email you or anyone who can assist from my work address if you
> would be willing to help out?
>
> Many thanks
>
> Lee

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: Re: Refresh DIV seems to cause memory leak problem in IE

by Kristiono Setyadi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Did you experience this *only* with IE and not the other browser?

If you do, maybe I can see the full source code (not all, but only the code respect
to this task). You can send me private email of your code and a details explanation
what you want to achieve with this code.

Oh, don't forget mention the browser too (which is work best, and which is not).

Thank you.


Kristiono Setyadi

Web Programmer and Developer
Citraweb Nusa Infomedia
http://citra.web.id/

http://kristiono-setyadi.net/

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.