Inbouw probleem JS menu

Gestart doorRobertt4 reacties16 weergaven

5 berichten · pagina 1 van 1

Robertt

Lid · Topicstarter

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik ben bezig met me fansite ik begon met het inbouwen van het menu, hier liep ik dus al vast. Ik heb een menu gemaakt uit JS:

function tab_home() {
 document.getElementById(sub_menu).innerHTML = <a href="#" onClick="tab_nieuws();">Ga naar het Nieuws XD</a> ;
}

function tab_nieuws() {
 document.getElementById(sub_menu).innerHTML = <a href="#" onClick="tab_fancenter();">Ga naar het Fancenter XD</a>;
}

function tab_fancenter() {
 document.getElementById(sub_menu).innerHTML = <a href="#" onClick="tab_contact();">Ga naar het Contact XD</a>;

}
function leden() {
 document.getElementById(sub_menu).innerHTML = [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]    [COLOR= #FF8000]// Dit betekent, Als de gebruiker niet is ingelogd. [/COLOR]?> | <a href="?p=registreren">Registeren</a> | 
 <a href="?p=login"Inloggen</a> | <a href="?p=wwvergeten">Wachtwoord Vergeten</a> [COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR] [COLOR= #FF8000]// Dit betekent, Als de gebruiker WEL is ingelogd. [/COLOR]?>

}


Maar dit werkt niet? hij ondersteund geen PHP is er een mogelijkheid om dit wel te laten werken?

Crazydog
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Laat is heel je script zien
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
function tab_home() {
 document.getElementById(sub_menu).innerHTML = <a href="#" onClick="tab_nieuws();">Ga naar het Nieuws XD</a> ;
}

function tab_nieuws() {
 document.getElementById(sub_menu).innerHTML = <a href="#" onClick="tab_fancenter();">Ga naar het Fancenter XD</a>;
}

function tab_fancenter() {
 document.getElementById(sub_menu).innerHTML = <a href="#" onClick="tab_contact();">Ga naar het Contact XD</a>;

}
function leden() {
 document.getElementById(sub_menu).innerHTML = [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]    [COLOR= #FF8000]// Dit betekent, Als de gebruiker niet is ingelogd. [/COLOR]?> | <a href="?p=registreren">Registeren</a> | <a href="?p=login"Inloggen</a> | <a href="?p=wwvergeten">Wachtwoord Vergeten</a> [COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR] [COLOR= #FF8000]// Dit betekent, Als de gebruiker WEL is ingelogd. [/COLOR]?>

}


Je kan in een innerHTML geen enter zetten
0
Robertt

Lid · Topicstarter

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Werkt niet heb nu dit (heb menu nu even opgeslagen in php)

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"content-type: application/x-javascript"[/COLOR][COLOR= #007700]);[/COLOR] 
?>
function tab_home() {
 document.getElementById(sub_menu).innerHTML = <a href="#" onClick="tab_nieuws();">Ga naar het Nieuws XD</a> ;
}

function tab_nieuws() {
 document.getElementById(sub_menu).innerHTML = <a href="#" onClick="tab_fancenter();">Ga naar het Fancenter XD</a>;
}

function fancenter() {
 document.getElementById(sub_menu).innerHTML = [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]    [COLOR= #FF8000]// Dit betekent, Als de gebruiker niet is ingelogd. [/COLOR]?> | <a href="?p=registreren">Registeren</a> | <a href="?p=login"Inloggen</a> | <a href="?p=wwvergeten">Wachtwoord Vergeten</a> [COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR] [COLOR= #FF8000]// Dit betekent, Als de gebruiker WEL is ingelogd. [/COLOR]?>;

}
0
Robertt

Lid · Topicstarter

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Help?
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren