Hi,
function profilewindow(username, hyperlink)
{
newwindow=window.open(hyperlink + username,'name','height=400,width=500,toolbar=no,location=no,directories=no,status=no,
menubar=no,scrollbars=no,resizable=no,copyhistory=no');
Ein Zeilenumbruch im String ist nicht zulässig.
}
und hier nun der Aufruf:
<a href='#' target='_self' onClick=javascript:profilewindow('paul', 'contents/content_userprofile.php?username=');>
Was ist hier falsch?
Im Gegensatz zu Struppi meine ich: einiges:
Es fehlen die Anführungszeichen um den Attributwert des onclick-Attributs.
javascript: ist in Eventhandlern bestenfalls sinnfrei, oft aber auch falsch (hängt davon ab, ob der Interpreter Labels kennt).
Warum nicht
<a href="contents/content_user_profile.php?username=paul" target="name" onclick="profilewindow(this.href);">
und
function profilewindow(hyperlink)
{
newwindow=window.open(hyperlink, 'name', //ab hier wie gehabt, aber ohne Umbruch
cu,
Andreas
Der Optimist: Das Glas ist halbvoll. - Der Pessimist: Das Glas ist halbleer. - Der Ingenieur: Das Glas ist doppelt so groß wie nötig.
http://mud-guard.de/? http://www.andreas-waechter.de/ http://www.helpers.de/