473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

'Access Denied' when using javascript to change page location

Hello,

I have a problem when I try to do this on a aspx page..
Is there anything wrong with this approach?
This is the javascript function

<Script Language='JavaScript'>
function OpenLink(Link){
parent.right.document.location=Link;
}</Script>

And I call it like this:

<A HREF=javascript:OpenLink('MyRequests.aspx')></A>

The strange thing about it is that if I use the localhost
address this code works, but if I put in the machine name
as the address to the web page, I get an 'access denied'
on the second line in the javascript function
(parent.right.document.location = Link;)

Appreciate any help!
thanks,
John
Nov 17 '05 #1
1 2223
Hello

What you are trying to do is called cross domain scripting, which means that
a javascript in one html document tries to access objects in another html
document and the other html document comes from a different domain.
(localhost and machine name are considered different domains even though
they are the same machine and same website).

Web browsers are designed to prevent this for security reasons. Imagine a
malicious website reading your hotmail email because you happen to read your
email and browse the malicious site at the same time. This is by design.

So make sure that all documents come from the same domain.

Best regards
Sherif

<an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Hello,

I have a problem when I try to do this on a aspx page..
Is there anything wrong with this approach?
This is the javascript function

<Script Language='JavaScript'>
function OpenLink(Link){
parent.right.document.location=Link;
}</Script>

And I call it like this:

<A HREF=javascript:OpenLink('MyRequests.aspx')></A>

The strange thing about it is that if I use the localhost
address this code works, but if I put in the machine name
as the address to the web page, I get an 'access denied'
on the second line in the javascript function
(parent.right.document.location = Link;)

Appreciate any help!
thanks,
John

Nov 17 '05 #2

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

Similar topics

7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
1
by: Darren Lew | last post by:
Hi there, I have this problem which is really driving me nuts for a couple of days. Glad if any help or suggestion is given Javascript will give me a pop-up error "Access is denied" when i try...
0
by: Goran | last post by:
Hi I have created a very simple ASP.Net application that only consists of a CrystalReports Viewer, that has been connected to a .rpt file. When the page is loaded in the browser, the following...
5
by: Gene | last post by:
What are some ways I can deny access to an aspx page other than removing it altogether from the site? I need the ability to temporarily prevent all users from accessing certain pages. Thanks.
12
by: Ron Weldy | last post by:
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net files. On my workstation I have a share set up to the folder where the web files reside. I am just doing quick and dirty...
4
by: Chrisser | last post by:
Hi I have an Intranet webpage starting with a mainpage from which the user can open a new window using a link that is calling a function: function openWindows(){ var left, top; width =...
5
by: rn5a | last post by:
I have a ASPX page which has a ListBox & a Button. The ListBox lists all the files & directories existing in a directory on the server. I want to give users the option to download files from the...
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
6
by: suresh_nsnguys | last post by:
Hi, This is my first message to this forum.I am facing one problem in frames.when i am trying to access child frame from parent frame i am getting "Access Denied Error".i know the reason bcz i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.