Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Title mit Ajax ändern

Empfohlene Antworten

Seit langem mal wieder ne Frage.

Meine Website Navi läuft mit Ajax.

Übergebe im Link den Namen der Seite, die angezeigt werden soll, hol mir den Inhalt

document.getElementById('myContent').innerHTML = xmlHttpObject.responseText;

Und zeig den in einem Div an.

Soweit so gut.

Nur hab ich noch nicht gefunden, wie ich den Seitentitel dynamisch änder.

Irgendwie <title> aus der anzuzeigenden Seite auslesen und dann mit document.title setzen, aber wie?

Hallo,

dazu kann dir die Doku auf Self Html gut Auskunft geben. <title> ist ein DOM Node wie alle anderen auch und gehört zum Document Object.

Ich empfehle dir JQuery zu nutzen damit fährst du deutlich besser und musst dich nicht und Browserabweichungen kümmern.

Ansonsten musst du den title Node mit document.getElementsByTagName('title')[0]; dir holen und kannst dann den Textnode davon ändern.

Gruß Lit-Web

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.