where is the html from a document.write()?

M

Matthew Crouch

Sorry, more dumb newb questions.

I've got part of a page that seems to be rendering just fine. It's built by:
function writeTabPanel(){

var tpText = '';
tpText += '<div id="';
tpText += this.tab.id;
[...]
tpText += '">';
tpText += '</iframe>';
document.write(tpText);
}

and i'd like to be able to see the source so i can tell where i lost the
value of a couple variable. but all i can find is the place where this
is called:
var tabPanel2 = new tabPanel(tab2,panel2,document.forms[0],0);
tabPanel2.writeTabPanel();


//show first panel
showPanel("tab1","panel1",this.form);
 
E

Evertjan.

Matthew Crouch wrote on 07 okt 2005 in comp.lang.javascript:
I've got part of a page that seems to be rendering just fine. It's
built by:
function writeTabPanel(){

var tpText = '';
tpText += '<div id="';
tpText += this.tab.id;
[...]
tpText += '">';
tpText += '</iframe>';
document.write(tpText);
}

You cannot use document.write() after the page displays without overwriting
the whole page, including the script.
 
R

Randy Webb

Matthew Crouch said the following on 10/7/2005 3:36 PM:
Sorry, more dumb newb questions.

I've got part of a page that seems to be rendering just fine. It's built
by:
function writeTabPanel(){

var tpText = '';
tpText += '<div id="';
tpText += this.tab.id;
[...]
tpText += '">';
tpText += '</iframe>';
document.write(tpText);
}

and i'd like to be able to see the source so i can tell where i lost the
value of a couple variable. but all i can find is the place where this
is called:
var tabPanel2 = new tabPanel(tab2,panel2,document.forms[0],0);
tabPanel2.writeTabPanel();


//show first panel
showPanel("tab1","panel1",this.form);

Post a URL to the full code. Snippets of code, in this case, are of no use.

Try this in the URL bar of IE, it will give you the page source, all
prettied up for you:

javascript:'<code><ol><li>'+(document.documentElement||document.body).outerHTML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/%20%20/g,"&nbsp;%20").replace(/(\n\r?|\r)/g,"<li>")+'<\/ol><\/code>';
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top