Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new URL for an in-place activation window does not work

Status
Not open for further replies.

terrylin

Programmer
Jul 27, 2004
5
US
Once a window is created and loaded with an in-place activation document (Word or Excel), I can't send a new URL to the window. When I click on "doc" button, a window is created and Word document displayed in the window. But when I click on "htm" button, nothing happens. The Word document still display in the window. Any ideas?


<script language=JAVASCRIPT>
<!--
var win;
function open_window() {
win=open(" win.focus();
}
//-->
</script>

<input type=button value=doc onclick='open_window();'>
<input type=button value=htm onclick='win.location.href="
 
alert returns "[object]". It seems like it did not get set.
If I open HTM document first and then DOC document, same code work. I think it has something to do with IE's in-place activation window.
 
well [object] means it has been set. give me sometime, let me try and simulate ur code here...

Known is handfull, Unknown is worldfull
 
Try this for size:

Code:
<html>
<head>
	<script type="text/javascript">
	<!--
		var win = null;
		function open_window(url) {
			win = window.open(url, 'myWindow', '');
			win.focus();
		}
	//-->
	</script>
</head>

<body>
	<form>
		<input type="button" value="doc" onclick="open_window('[URL unfurl="true"]http://172.25.2.24/adsdoc/test.doc');">[/URL]
		<input type="button" value="htm" onclick="open_window('[URL unfurl="true"]http://172.25.2.24/test.htm');">[/URL]
	</form>
</body>
</html>

Hope this helps,
Dan
 
The code does work but with one problem.

When I bring DOC document first and then HTM document, the code failed at win.focus() with "Error on Page" message. HTM document did display though.
 
yup, trrylin, i tried ur code and came up with the same problem, at the maximum only the url changes, the embeded doc remains, i guess nothing can be done about it, a workaround could be to close the doc window and open a new window that goes to the htm...

Known is handfull, Unknown is worldfull
 
The problem is that I can't close the doc window by calling win.close(). I'm getting "member not found" message trying to do that. Is there other way to close a window?
 
win.close() works fine for me...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top