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.

Javascript: übergeben von variablen

Empfohlene Antworten

Veröffentlicht

hallo leute,

wie kann ich in javascript variablen einer funktion an eine andere übergeben?

hier mein script: die variable alle soll an die function set_cookie übergebn werden.

grüße und vielen dank für eure hilfe

function catch_all()

{

// catch contents of all form fields

var s1 = document.f.s1.value;

var s2 = document.f.s2.value;

var s3 = document.f.s3.value;

var s4 = document.f.s4.value;

var s5 = document.f.s5.value;

var s6 = document.f.s6.value;

var s7 = document.f.s7.value;

var s8 = document.f.s8.value;

var s9 = document.f.s9.value;

var s10 = document.f.s10.value;

var s11 = document.f.s11.value;

var s12 = document.f.s12.value;

// catch contents of all combo boxes

var co1 = document.f.co1.options[document.f.co1.selectedIndex].value;

var co2 = document.f.co2.options[document.f.co2.selectedIndex].value;

var co3 = document.f.co3.options[document.f.co3.selectedIndex].value;

var co4 = document.f.co4.options[document.f.co4.selectedIndex].value;

var co5 = document.f.co5.options[document.f.co5.selectedIndex].value;

var co6 = document.f.co6.options[document.f.co6.selectedIndex].value;

var co7 = document.f.co7.options[document.f.co7.selectedIndex].value;

var co8 = document.f.co8.options[document.f.co8.selectedIndex].value;

var co9 = document.f.co9.options[document.f.co9.selectedIndex].value;

var co10 = document.f.co10.options[document.f.co10.selectedIndex].value;

var co11 = document.f.co11.options[document.f.co11.selectedIndex].value;

// count hits

var l = document.f.l.options[document.f.l.selectedIndex].value;

// assemble form fields and check boxes to one string

// delimiter

var deli = "\|";

alle = s1+deli+co1+deli+s2+deli+co2+deli+s3+deli+co3+deli+s4+deli+co4+deli+s5+deli+co5+deli+s6+deli+co6+deli+s7+deli+co7+deli+s8+deli+co8+deli+s9+deli+co9+deli+s10+deli+co10+deli+s11+deli+co11+deli+s12+deli+l;

//alert(alle);

}

function set_cookie(Name, alle, Verfall)

{

var ablauf = new Date();

var infuenfTagen = ablauf.getTime() + (5 * 24 * 60 * 60 * 1000);

var wert = alle;

ablauf.setTime(infuenfTagen);

alle = document.f.alle.value;

document.cookie = Name="Boris"+"="+wert+"; expires="+ablauf.toGMTString()+";";

}

hi leute,

benötige keine hilfe mehr. konnte den fehler selber finden.

:D

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.