473,805 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access denied error in iframe

28 New Member
I have created iframe with following code
Expand|Select|Wrap|Line Numbers
  1. <iframe src="http://astore.amazon.com/" width="100%"  frameborder="0" name="amframe" id="amframe" height="1" scrolling="no" onLoad="resizeFrame1();" ></iframe>
  2.  
I have used following javascript code to access scrolheight of iframe , in order to remove scroll bar based on the height
Expand|Select|Wrap|Line Numbers
  1. var h= document.getElementById("amframe").contentWindow.document.body.scrollHeight
  2.  
I got "access denied" javascript error at the time of execution . I wish to know how to correct this error

Thanks in advance
Apr 19 '08 #1
1 7965
gits
5,390 Recognized Expert Moderator Expert
hi ...

in case (and in your case it is) the loaded page in the frame is from another domain you cannot access it with javascript due to security issues ... because in case you could ... then you could 'Cross-Site-Script' and that would be a security hole ... you may have a look here

kind regards
Apr 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1912
by: Steve | last post by:
This really surprised me. I setup an iFrame in my document to display data from another table. For me, this was a way to be able to update that data without having to reload the whole page. Also, the iFrame gives me the ablity to have a scrolling table of results that doesn't fill up the whole screen when a lot of data is present. when I read in the main page, the src of the iframe is set to a URL like...
1
11108
by: Cindy Lee | last post by:
I'm trying to dynamically set the height of my Iframe. my https: main page is calling another https in an Iframe. But i get an access denied error from my javascript trying to call the parent document. Main https page <IFRAME APPLICATION="yes" style="width:100%;" id="iframename" frameborder="no" scrolling="no" SRC="https://www.otherdomain.com">
1
5145
by: srivatsans101 | last post by:
Hi, I'm trying to access the IFrame contents on a HTML page as frames.document But in IE, I'm getting Access Denied Error Message. I tried to add the IFrame's Src WebSite (a local/intranet hosted dynamic HTML page) to Trusted Sites list in IE Options.
3
19885
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be found at www.srmiles.com/freestuff/ajax_file_uploader/ . you can do multiple file uploads. each upload will have it's own "form"-tag, so that each file is uploaded for its own. could be a good solution if there are "big" uploads.
5
10474
by: Mel | last post by:
I need to access an element of my top window from inside an IFrame within that window. I tried: parent.MYFRAME.document.getElementById("LHS"); and i get a "Access Denied" is there a way to do this ?
3
3343
by: ysakaed | last post by:
Hi I am trying to get the content of the iframe to replace the content inside a div here is the code i use. function changeContent(content) { var buf = content + "_2"; var iframe = document.getElementById(buf); document.getElementById(content).innerHTML = (iframe.contentDocument || iframe.contentWindow.document).documentElement.innerHTML; }
4
2050
by: jambalapamba | last post by:
hi all i am loading a html document in my iframe which comes from the same domain, when i am trying to acess the document(html page) in the iframe using java script i am getting access denied , but some times its not giving me error and i am able access the document. its inconsistent like some time it gives me error and sometimes not(for the same document). Inside the html document its refering to the website images that are not in...
11
3657
by: SSG001 | last post by:
i have a form and in that i iframe in the main form <form name='form1> <iframe name="frame1" id="iframe1" src="iframe1.php" scrolling="yes" width="300%" frameborder="0" height="300"></iframe> <input type="button" name="save" onclick="save();"> </form> function save(){ window.frames.document.forms.add.click(); document.form1.submit();
0
9718
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
10614
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
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...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6876
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
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
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.