Forum Moderators: open
document.write(" <a href=http://www.linkedpage.htm target=gf onClick=fgf = window.open('','gf');fgf.focus()>
(followed by - but less important)
<font size=<? echo "$fontsize" ;?> color=#<? echo "$titlefontcolor" ;?> face=<? echo "$fonttype" ;?>>Recent Studies:</font></a>");
the function fgf just opens the linked page in a new window. I know there isnt much code there to play with but i know the problem is just something like missing " or something. the mixture of 3 languages in causing the problems, cause php has " as a special character. anyone have any suggestions on how to make this line of code work?
"onlick=fgf = window.open('','gf');" - this part is where im guessing the problem arises cause of the two equals signs... any ideas anyone?
document.write(" <a href=http://www.linkedpage.htm target=gf onClick=fgf = window.open('','gf');fgf.focus()>
You're not using quotes around your hred, target and onclick. While these can be omitted they really shouldn't Also, you're onclick has a second equals sign which may be throwing things out...
Try:
document.write(" <a href='http://www.linkedpage.htm' target='\gf' onClick='fgf = window.open(\'\',\'gf\');fgf.focus()'>
Also, what error are you getting?
Have you closed your document.write?
Remember, if you use document.write() to write data that contains double quotes, simple use single quotes to wrap the string and vice-versa.
e.g. document.write("Peter's party starts at 8 O' Clock"); is ok
but document.write('Peter's party starts at 8 O' Clock'); is garbage.
Kaled.
Tag attributes MUST BE IN DOUBLE QUOTES if they contain spaces or some other special chars such as =<>.
I'm afraid that's not entirely true kaled. SGML (and hence HTML) specifies that attribute values can be in either double or single quotes. Both are equally valid and correct.
From: [w3.org ] :
By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39). Single quote marks can be included within the attribute value when the value is delimited by double quote marks, and vice versa.
If you have an attribute value that contains a single quote then use a double quote and vice versa.
HTH