Of Course! Thank you so much for slapping me :lol:
"Mick White" <mwhite13@BOGUSrochester.rr.com> wrote in message
news:AmEFc.365$yd5.204@twister.nyroc.rr.com...[color=blue]
> gf wrote:
>[color=green]
> > Well, I chastised myself too soon :) Here is more of the real script,[/color][/color]
so I[color=blue][color=green]
> > do not believe I am overwriting myself.
> >
> > <script>
> > function callHelp(page) {
> > var helpWin =
> >[/color][/color]
window.open('','rwh_help','status=1,menubar=0,tool bar=0,width=400,height=600[color=blue][color=green]
> > ');
> > with (helpWin.document) {
> > open();
> > writeln('<html><head><title>Help</title></head>');
> > writeln('<center><a href="http://somedomain.com" target="_blank"><b
> > style="color:blue;">Test</b></a></center>');
> > writeln('<br /><table border=1>');
> > if (page=='main') {
> > writeln('<tr><td>This is a test</td></tr><tr><td align="right"><a
> > href="javascript
:callHelp(\'page2\');" >Next >> </a></td></tr>');[/color]
>
> writeln('<tr><td>This is a test</td></tr><tr><td align="right"><a
>[/color]
href="javascript
:opener.callHelp(\'page2\');">Next >> </a></td></tr>');[color=blue]
> Mick
>
>[color=green]
> > }
> > else if (page=='page2') {alert(page);
> > writeln('page 2');
> > }
> > writeln('</table></html>');
> > close();
> > return;
> > }
> > }
> > </script>
> >
> > "Jman" <likea@rock.com> wrote in message
> > news:40e63c36$1_4@news.athenanews.com...
> >[color=darkred]
> >>"gf" <gfraley5@earthlink.net> wrote in message
> >>news:dSpFc.2819$oD3.2663@newsread1.news.pas.eart hlink.net...
> >>
> >>><script>
> >>> function testme(testvar) {
> >>> if (testvar=='1') {
> >>> alert('testvar=1');
> >>> document.open();
> >>> document.write('This is just some text<br /><br />");
> >>> document.write('<a href="javascript
:testme(\'2\');" >Next
> >>>
> >>>> </a>');
> >>>
> >>> document.close();
> >>> }
> >>> else if (testvar=='2') {
> >>> alert('testvar=2');
> >>> }
> >>> }
> >>></script>
> >>><a href="javascript
:testme('1');" >Next >> </a>
> >>>
> >>>
> >>>It seems that this should work, but alas, it doesn't. What I am[/color]
> >
> > emulating
> >[color=darkred]
> >>>in this example is a case where you start off with a hyperlink that[/color]
> >
> > calls
> >[color=darkred]
> >>>TESTME and produces another hyperlink. When you click on the[/color][/color][/color]
hyperlink,[color=blue][color=green][color=darkred]
> >>
> >>it
> >>
> >>>errors out and produces "object expected" in IE and "Error: callHelp is
> >>
> >>not
> >>
> >>>defined" in NS. Why is it saying callHelp is not defined and how do I[/color]
> >
> > fix
> >[color=darkred]
> >>>this?
> >>>
> >>>Thanks.
> >>
> >>
> >>You just overwrote your entire document, with a new document that has no
> >>script in it... so then
> >>when you click on the link, it has no function to refer to any longer...
> >>
> >>If you included the function definition inside the text to be written to[/color]
> >
> > the
> >[color=darkred]
> >>document, then you might get it to work.
> >>
> >>Run this script and view the source; you see what now is in the[/color][/color][/color]
document;[color=blue][color=green][color=darkred]
> >>not much, and certainly no function definition to be called a second[/color][/color][/color]
time.[color=blue][color=green][color=darkred]
> >>
> >>It's not entirely clear to me why you would want to do anything quite[/color][/color][/color]
like[color=blue][color=green][color=darkred]
> >>this.. but usually the best way to operate is to put everything inside[/color][/color][/color]
of[color=blue][color=green]
> >
> > a
> >[color=darkred]
> >>string, contantinating every new statement into on big string or var,[/color][/color][/color]
and[color=blue][color=green][color=darkred]
> >>then write out the var at the end out to the document with one
> >>document.write statement at the end, like:
> >>
> >>var a = "this is some text <br>";
> >>
> >>a += "this is some more text too <br>";
> >>
> >>a += "this is the final line of text to be written to the document.[/color][/color][/color]
<br>";[color=blue][color=green][color=darkred]
> >>
> >>document.write (a);
> >>
> >>Also, you might want to write text into a DIV tag, or some other object[/color]
> >
> > that
> >[color=darkred]
> >>can act as a container so that the rest of your document is not affected
> >>(erased) when you write into it.
> >>
> >>Personally, I like looking at this kind of thing in a debugger; it's a
> >>little easier some times to see how things are working when you can[/color][/color][/color]
watch[color=blue][color=green][color=darkred]
> >>the vars change as the script executes, and be able to see into DOM[/color]
> >
> > objects
> >[color=darkred]
> >>to see if they are null or assigned with ids and values as expected.
> >>
> >>
http://www.mandala.com/javascript/debug_javascript.html
> >>Javascript Debugging with the MS Script Editor
> >>
> >>Ciao,
> >>Jeff
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>[/color]
> >
> >
> >[/color][/color]