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";}

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...

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.