473,769 Members | 5,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Freed script

Hello all,

Is it possible to find out if a script is freed? This is actual when having
a pointer to a function and should determine if it is freed so we don't call
it and get error..

TWH
Nov 23 '05 #1
5 10470
VK

Thor W Hammer wrote:
Is it possible to find out if a script is freed?
How do you determine the term "freed" for JavaScript? ;-)
Any function exists in the scope until you manually removed it (by
setting to null).
a pointer to a function and should determine if it is freed so we don't call
it and get error..


if (typeof ptrMyFunction == "undefined" ) {
// then there is no such function
}

Nov 23 '05 #2
No, if I have a pointer to a function that exists inside a frame (iframe)
and the the frame is unloaded or navigated to another place, then function
is still in memory but it is freed so that we get the error message "Can't
execute code from a freed script". What I want to do is to determine if the
script is freed so that I don't call it.
"VK" <sc**********@y ahoo.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .

Thor W Hammer wrote:
Is it possible to find out if a script is freed?


How do you determine the term "freed" for JavaScript? ;-)
Any function exists in the scope until you manually removed it (by
setting to null).
a pointer to a function and should determine if it is freed so we don't
call
it and get error..


if (typeof ptrMyFunction == "undefined" ) {
// then there is no such function
}

Nov 23 '05 #3
VK

Thor W Hammer wrote:
No, if I have a pointer to a function that exists inside a frame (iframe)
and the the frame is unloaded or navigated to another place, then function
is still in memory but it is freed so that we get the error message "Can't
execute code from a freed script". What I want to do is to determine if the
script is freed so that I don't call it.


Oh, orphan script problem... It's even more interesting than freed/not
freed and never was really explored. In some circumstances you even
able to execute a function left from the previous page - as long as it
doesn't address to the DOM of the previous page (imaginary objects).
The latter simply crash Internet Explorer for example.

Well, I guess you still have a reliable checkpoint:
parent.frames['otherFrame'].document.locat ion
and match it against some variable.

Also standard JavaScript doesn't have package scope visibility but you
can emulate it:

function myFunction() {
arguments.calle e.packageName = 'package 1';
// the rest of the function
}

and from your script later:
if ((typeof myFunction == 'object') &&
(myFunction.pac kageName == currentPackage) ) {
// ...
}

Nov 23 '05 #4
On 2005-11-21, Thor W Hammer <th*********@ho tmail.com> wrote:
No, if I have a pointer to a function that exists inside a frame (iframe)
and the the frame is unloaded or navigated to another place, then function
is still in memory but it is freed so that we get the error message "Can't
execute code from a freed script". What I want to do is to determine if the
script is freed so that I don't call it.


$0.02 solution: use try/catch

there may be a better way.

--

Bye.
Jasen
Nov 23 '05 #5
:-) Yep, I've already done that.
"Jasen Betts" <ja***@clunker. homenet> wrote in message
news:slrndo6tqh .lhb.ja***@clun ker.homenet...
On 2005-11-21, Thor W Hammer <th*********@ho tmail.com> wrote:
No, if I have a pointer to a function that exists inside a frame (iframe)
and the the frame is unloaded or navigated to another place, then
function
is still in memory but it is freed so that we get the error message
"Can't
execute code from a freed script". What I want to do is to determine if
the
script is freed so that I don't call it.


$0.02 solution: use try/catch

there may be a better way.

--

Bye.
Jasen

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1721
by: Riley DeWiley | last post by:
There is a way to ask a data source how much space would be freed if compaction were to be done. I saw the reference, but now cannot find it. Anyone know where that web page was? Even Google has not helped. RDeW
73
2488
by: David Scarlett | last post by:
Is the following code safe? SomeType *a, *b; /* Some code.... */ free(a);
72
3630
by: ravi | last post by:
I have a situation where i want to free the memory pointed by a pointer, only if it is not freed already. Is there a way to know whether the memory is freed or not?
1
2141
by: lars.uffmann | last post by:
Hello everyone! I just debugged a pretty huge project, eliminating basically every memory leak that would occur with the current configuration files, at least according to the mtrace() tool from the library <mcheck.h>. Now the very last bugs I seem to be incapable of eliminating are: - 0x000000000061f460 Free 387310 was never alloc'd 0x2aaaab053b53 - 0x000000000061f040 Free 387311 was never alloc'd 0x2aaaab053b53
8
8051
by: shrik | last post by:
I have one main page which contains two iframes say 'leftpanel' and 'content'. leftpanel contain page which has tree in it. Now whenever i clikc on the partiucular node the pages in the 'content' changes accordingly. But dont know why whenever i clicks on the node in tree it gives error cannot execute code from freed script. Only in IE 6. Can anyone help me with that?
10
8339
by: frakie | last post by:
Hi 'body, is there a method to check if a pointer is pointing a freed memory location?
2
6038
by: maya | last post by:
hi, I keep getting this error, "can't execute code from a freed script" when I go to another page (i.e., upon UNLOAD..) this error occurs only in IE, not FF (what a surprise.....;) what is this error, pls.. it's for a site I've been working on for a few weeks now, started getting this error just a few days ago.. (I looked this up, saw that often this error has to do with frames, but my
58
4930
by: sh.vipin | last post by:
is there any way to find out number of bytes freed on a particular free() call in C
0
9586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.