Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't execute code from a freed script

Status
Not open for further replies.

TMac42

Programmer
Joined
Jul 24, 2000
Messages
83
Location
US
I have a site of ASP pages. Those ASP pages all use the same <SCRIPT> for a menu system. The location of that script is in one of each page's #INCLUDE(d) files. (More: I have a top.asp page that is included that writes the same <html><head>, <script> etc. tags for every page.)

I am NOT using frames.

Probably 98% of the pages all work great. The other 2% are giving me issues with the error in the Subject line. Here's the scoop:

I have a basic ASP page that is passed a document name (for a .htm file) and then checks to see if it exists (using the FileSystemObject). If it does exist, it opens it up with a ReadAll and I Response.Write the string.

The page loads up fine but if I click Refresh or Back, I get &quot;Can't execute code from a freed script.&quot; By process of elimination, I have narrowed it down to the following line:

Response.Write(txtDoc.Readall)

of...

If fso.FileExists(m_strPath & &quot;\MyDocuments\&quot; & m_strDocName & &quot;.htm&quot;) Then
Set txtDoc = fso.OpenTextFile(m_strPath & &quot;\MyDocuments\&quot; & m_strDocName & &quot;.htm&quot;,1, False)
Response.Write(txtDoc.Readall)
End If

--- If I comment out the Response.Write line, I do not get the error but I'm also removing the key functionality of the page - writing the text of the specified file.

Everything I read online points to client-side JavaScript, thus my post. Can any of you JS gurus give me some direction? Thanks!
 
i think i had this problem when i inadvertently changed IE's encoding from Western European (Windows) to Unicode(UTF-8)

changing back to Western European fixed it for me

in IE:
View > Encoding > Western European (Windows)





=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Your suggestion didn't resolve my issue, but thanks.

The problem was due to my doing a Response.Write of HTML code for numerous other pages I was displaying in my ASP page. I think it freaked the browser out a bit. So, I changed my code to now do a .Readall and assign that to a string. Then, I search for </head><body tags and remove everything up to <body>. I then remove the closing </body></html> tags so now my source is really just another HTML table and it works like a champ.

Thanks to everyone for their help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top