script within writeln Help!

admin

Administrator
Staff member
I'm having some trouble with my web page ( <!-- m --><a class="postlink" href="http://www.aengblom.com">http://www.aengblom.com</a><!-- m --> )


I have a javascript function that a friend helped me with, but who is
now unavailable. I wanted to make some alterations as an afterthought,
but I'm only at the beginning level and I can't seem to figure out how
to alter it to my exact specifications.

I would appreciate any help!

Here's my script:

<script type="text/javascript" language="javascript">

for( var i in aMaininfo )
{

if( aMaininfo[cID] == "" ) //skip the one that is
blank
continue;
document.writeln( "<p><a href='http://www.webdeveloper.com/forum/archive/index.php/" + aMaininfo[cHREF]

+ "' onClick='window.open(\""
+ aMaininfo[cHREF] + "\");return false;'
id='" + aMaininfo[cID]
+ "' onMouseOver='setInfo( " + i + " );'>"
+ aMaininfo[cTEXT] + "</a></p>" );

}
</script>

aMaininfo, id, cHREF, cID, cText and setInfo are variables that are
defined in an earlier script that you can see at my site. (Some line
breaks added for clarity)

I want the window.open line to open a window (which it does
successfully), but set the height, width and remove all the menu's etc
except the title bar and scroll bars if needed.

For example I have tried this:

document.writeln( "<p><a href='http://www.webdeveloper.com/forum/archive/index.php/"
+ aMaininfo[cHREF]
+ "' onClick='window.open(\""
+ aMaininfo[cHREF] + "\", "
+ "name," + "width=200,height=200");return false;'
id='" + aMaininfo[cID]
+ "' onMouseOver='setInfo( " + i + " );'>"
+ aMaininfo[cTEXT] + "</a></p>" );

...and a number of other variations, but it doesn't work.

If anyone would be so kind I'd love to know WHY it would work as well.
It seems I can't figure out home many quotes, single-quotes, plus signs and backslashes and where they should go.

Thanks you for any help

-Drew

feel free to e-mail me at javascript @ aengblom . com
 
Back
Top