ASP "no right" error

E

Edward King

I have a statement in a asp,like follows£º
var str=window.top.main.document.all.contenttext.value;

I use IIS5.0 to deploy this asp,then I visit this asp like follows:
http://localhost/test/default.asp

I found I can get this page,then I use my computer's IP address,
http://192.168.0.3/test/default.asp

I got errors! It said "no right"£¬then I erase this statement,then I visit
this asp again,this time I don't get error.But I need this statement "var
str=window.top.main.document.all.contenttext.value"
How to correct my code to run it?

Thanks!
 
H

Hans Kesting

Edward said:
I have a statement in a asp,like follows£º
var str=window.top.main.document.all.contenttext.value;

I use IIS5.0 to deploy this asp,then I visit this asp like follows:
http://localhost/test/default.asp

I found I can get this page,then I use my computer's IP address,
http://192.168.0.3/test/default.asp

I got errors! It said "no right"£¬then I erase this statement,then I
visit this asp again,this time I don't get error.But I need this
statement "var str=window.top.main.document.all.contenttext.value"
How to correct my code to run it?

Thanks!

This is not an asp.net problem, but client-side javascript/html.

Apparently you are using frames, and from the frameset that is
loaded from "192.168.0.3" you are referring to frames with
a different server address ("localhost" ?). *you* know this is the
same machine, but the browser doesn't! So you run into a security
block: you can't access frames loaded from a different domain!

Solution: use relative paths to load the frames, so they are also
loaded from the "192.168.0.3" server.

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,269
Messages
2,571,100
Members
48,773
Latest member
Kaybee

Latest Threads

Top