Hallo!
Zu folgendem Skript habe ich eine Frage:
function selectedtext()
{
if (top.location.pathname.substring(68,76) == 'English') {
if (document.all)
{ text = document.selection.createRange().text; }
else
{ text = document.selection; }
if (window.getSelection) { parent.Dict.location.href= "../Dict"/ + text.substring(0, 1) + ".html#" + window.getSelection() };
else if (document.getSelection) {parent.Dict.location.href = "../Dict/" + text.substring(0,1) + ".html#" + window.getSelection()};
else if (document.selection){parent.Dict.location.href = "../Dict/" + text.substring(0,1) + ".html#" + document.selection.createRange().text};
else if (document.selection){parent.Dict.location.href = "../Dict/" + text.substring(0,1) + ".html#" + document.selection.createRange().text + "1"};
}
else alert("Leider hast du weder Möglcihkeit A noch B ausgewählt!")
; }
Dieses Skript prüft die Zeichen von 68-76 des Url-Pfades. Wie bekommen ich jetzt hin, dass in dieser Zeile
if (top.location.pathname.substring(68,76) == 'English')
die Bezeichnung "English" als ein Teil des URL-Pfades identifiziert wird? Ich habe es bisher mit einfachen, doppelten und ohne Anführungszeichen versucht, aber jedes Mal umgeht er meine If-Abfragen.
Gruß David!