0

I have an iframe that is used to access the server so the entire page doesn't reload. The frame works great the first time but after the frame has preformed the query and reloaded, if the script tries to access the frame, I get a "permission denied" error.

server = (document.all) ? window.frames['SERVER_REQUEST'].document.getElementsByTagName('input') : document.getElementById('SERVER_REQUEST').contentWindow.document.getElementsByTagName('input');
	post_edit.onclick = function() {
		server['REQUEST_CRITERIA_0'].value = "some value";}
1
Contributor
2
Replies
3
Views
7 Years
Discussion Span
Last Post by cloud09
0

After working with the script more, I discovered some even more baffling information:
1)The script works fine in firefox - behave exactly as expected and no errors
2)In chrome, the script will not submit the form in the iframe more than once, but no errors are produced. I'm assuming its the same type of permission thing, but the error console is empty.

server_inputs = (document.all) ? window.frames['SERVER_REQUEST'].document.getElementsByTagName('input') : document.getElementById('SERVER_REQUEST').contentWindow.document.getElementsByTagName('input');
	server = [];
	for(s=0;s<server_inputs.length;s++) {
		server[server_inputs[s].id] = server_inputs[s];}
	post_edit.onclick = function() {
		var count = 0;
		for(i=0;i<posts.length;i++) {
			if(posts[i].checked == true) count++;}
		if(count > 1) {
			alert("Please select only one post to edit at a time.");
			return false;}
		for(i=0;i<posts.length;i++) {
			if(posts[i].checked == true) {
				server['REQUEST_CRITERIA_0'].value = posts[i].value;
				server['REQUEST_TYPE'].parentNode.submit();
//further code...

Edited by cloud09: n/a

0

The issue was solved by destroying the iframe after the data was retrieved and creating a new one each time the server needed to be accessed. I would still like to know however why IE (and chrome) did not allow the iframe to be reaccessed (specifically the form inside the iframe) after it had been sumitted. Any reply would be greatly appreciated.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.