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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternate methods to document.write

Status
Not open for further replies.

ErrolDC2

MIS
Apr 6, 2005
43
US
Hi. I'm trying to work around a problem and I was hoping to get some input from folks who are a bit more knowledgeable then me in this regard.

I have an application that some people in my company access via WebVPN, a service on the Cisco VPN concentrators.
A portion of this application uses js to do some stuff. One particualar element of this "stuff" writes some html into a pop-up window with document.write, but my vpn concentrator replaces document.write with webvpn_document_write and I think this is a known bug so I'm trying to work around the bug.

Here is the original code, as it sits on the server.
Code:
function signHandler(result){
	if (result != "OK") return;
	self.frames['submitFrame'].document.open("text/html");
	self.frames['submitFrame'].document.write("<html><body><form id='signForm' method='post' action='/DeltekTC/TimeCollection.msv'>" +
		"<input type='hidden' name='unit' value='TsSign'>" +
		"<input type='hidden' name='event' value='open'>" +
		"</form></body></html>");
	
	self.frames['submitFrame'].document.close();
	var signForm = self.frames['submitFrame'].document.getElementById('signForm');   
	top.setFormSubmitted();
	signForm.submit();

This is what it looks like when the concentrator mangles it.
Code:
function signHandler(result){
if (result != "OK") return;
self.frames['submitFrame'].document.webvpn_document_write=function(){
self.frames['submitFrame'].document.write()
}
self.frames['submitFrame'].document.open("text/html");
self.frames['submitFrame'].webvpn_document_write("<html><body><form id='signForm' method='post' action='/DeltekTC/TimeCollection.msv'>"+
"<input type='hidden' name='unit' value='TsSign'>"+
"<input type='hidden' name='event' value='open'>"+
"</form></body></html>",document);

self.frames['submitFrame'].document.close();
var signForm = self.frames['submitFrame'].document.getElementById('signForm');
top.setFormSubmitted();
signForm.submit();
}

Does anyone have any suggestions?

 
One correction the

Code:
self.frames['submitFrame'].document.webvpn_document_write=function(){
		self.frames['submitFrame'].document.write()
	}

is what we added to try and get around this issue. No luck obviously
 
perhaps try innerHTML?

Code:
function signHandler(result){
    if (result != "OK") return;
    
    self.frames['submitFrame'].document.body.innerHTML = 
    		"<form id='signForm' method='post' action='/DeltekTC/TimeCollection.msv'>" +
        "<input type='hidden' name='unit' value='TsSign'>" +
        "<input type='hidden' name='event' value='open'>" +
        "</form>";
    
    var signForm = self.frames['submitFrame'].document.getElementById('signForm');   
    top.setFormSubmitted();
    signForm.submit();

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top