intern gehts, extern nicht
jens25e
- javascript
Hallo
Ausserhalb der Firma bekommen die Leute anzeigt "undefined=undefined" oder "undefined is undefined", hier funktioniert es aber reibungslos, auf jedem Rechner. Woran kann das liegen?
Jens
Hi,
Ausserhalb der Firma bekommen die Leute anzeigt "undefined=undefined" oder "undefined is undefined", hier funktioniert es aber reibungslos, auf jedem Rechner. Woran kann das liegen?
An einem Script-Fehler.
(Du gehst bei Deiner detaillierten Fehler-Beschreibung ja hoffentlich nicht davon aus, eine detailliertere Lösung zu bekommen).
cu,
Andreas
Hier das komplette Script (in Häppchen, weil sonst zuviel). Es handelt sich um ein Aufklappmenü (ohne Grafiken)..ausser Firmenlogo und eine Linie..
Versteh nicht, wieso das Script an daran Schuld ist, das es intern geht aber von extern aus nicht.
<html>
<head>
<script language="javascript">
var win= null;
function NewWindow(mypage,myname,w,h,scroll) {
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable=no';
win=window.open(mypage,myname,settings);
return win;
}
var theMenu = new Array;
var mainMenuH = new Array; // height of menu
var theTipH = new Array; // height of description item
function layerSetup(id) {
theObj = document.getElementById(id);
return theObj;
}
function getHeight(id) {
theHeight = layerSetup(id).offsetHeight;
return theHeight;
}
function showDiv(id,posX,posY) {
layerSetup(id).style.visibility = 'visible';
layerSetup(id).style.left = parseInt(posX);
layerSetup(id).style.top = parseInt(posY);
}
function hideDiv(id) {
layerSetup(id).style.visibility = 'hidden';
}
function menuSetup(id,Ytop) {
this.space = 10; // vertical space between the menus
this.posX = 0; // distance from the left
this.id = id; // id arguement.
this.mainId = "mainMenu" + id; //name of main menu layer
this.tipId = "theTip" + id; // name of description layer
this.Ytop = Ytop; // Ytop arguement
this.posY=3; // start from 0 from the top
this.delay = 0; //delay of animation in miliseconds
this.timer; //this is used to set/reset the timer
this.measure = measure; // measures the height
this.showMenu = showMenu; // shows the menu
this.newPosition = newPosition; // move to new position
this.layerMove = layerMove; // move layers
this.slideMenu = slideMenu; //animate the menus
this.showTip = showTip; //show the description
}
function measure() {
mainMenuH[this.id] = getHeight(this.mainId);
theTipH[this.id] = getHeight(this.tipId);
}
function showMenu() {
// Kick off from the top position
posY=this.Ytop;
// Then loop through all the menus that are there to find the position of the next one:
for (var i=0;i<=this.id-1;i++) {
posY += parseInt(mainMenuH[i]) + this.space; //add the space between menu items
}
this.posY = posY; //make the object 'remember' where the menu is
showDiv(this.mainId,this.posX,posY); //position it and make visible
}
Happen Zwei:
function newPosition(id) { // hide the description in case it was showing hideDiv(this.tipId); //find the final Y pos where the menu is moving to posY=this.Ytop; for (var i=0;i<=this.id-1;i++) { posY += parseInt(mainMenuH[i]) + this.space; } // we check if it is the last menu // if it is, then we create a new method that will show the selected description after all menuSetup have animated down: if (this.id == mainMenuH.length-1) { var f="openTip(" + id + ")"; // declare the method that will move all the topnavs to make space for the description; show descriptions } this.finish = new Function(f); // created the new method // animate the menu down to posY, in steps of -5px: this.layerMove(posY,-5) }
function layerMove(posY,moveY) { // animate the menu to posY, in steps of moveY if (moveY>0) { // we're moving up var a=posY-this.posY; // this.posY is the current position of the menu, so compare that one to the destination } else { // moving down var a=this.posY-posY; } if (a>0) { // destination is not yet reached: this.posY = this.posY + moveY; // 'remember' the menu's position showDiv(this.mainId,this.posX,this.posY); // move the layer to that new position if(this.timer) { clearTimeout(this.timer); // clear the existing timer } //repeat this method after the set delay: eval("theMenu[" + this.id + "].timer = setTimeout("theMenu[" + this.id + "].layerMove("+posY+","+moveY+","+this.delay+")"," + this.delay + ")"); } else { // we have reached the destination, so run the finish method this.finish(); } }
function openTip(id) { for (var i=0;i<theMenu.length-1;i++) { //runs through all menus if (id <= theMenu[i].id) { theMenu[i+1].slideMenu(id); //move (animate) the next menu } } if (id == theMenu.length-1) {//if the chosen menu is the last one, then we don't have to move the next, as there or none theMenu[theMenu.length-1].showTip();//just show description } }
function slideMenu(id) { posY = this.Ytop; //find the Y pos posY+=theTipH[id]+this.space;//add space for descriptions for (var i=0;i<=this.id-1;i++) {//loop through the array posY += parseInt(mainMenuH[i]) + this.space; } //slide: var f="theMenu[" + id + "].showTip()";//show descriptions this.finish = new Function(f);// set the method this.layerMove(posY,5) }
function showTip() { posY = this.Ytop; // find the Y pos for (var i=0;i<=this.id;i++) { posY += parseInt(mainMenuH[i]) + this.space; // find top menu positions } // put under the top menu showDiv(this.tipId,this.posX,posY); //Show the layers }
function openMenu(id) { for (var i=0;i<theMenu.length;i++) { theMenu[i].newPosition(id); } }
var rubrik = "";
function standort1() { if (rubrik != "unternehmen") { openMenu('1'); rubrik = "unternehmen"; } }
function standort2() { if (rubrik != "aktuelles") { openMenu('2'); rubrik = "aktuelles"; } }
function standort3(){ if (rubrik != "produkte") { openMenu('3'); rubrik = "produkte"; } }
function standort4(){ if (rubrik != "anwendungen") { openMenu('4'); rubrik = "anwendungen"; } }
function standort5(){ if (rubrik != "bezugsquellen") { openMenu('5'); rubrik = "bezugsquellen"; } }
function standort6(){ if (rubrik != "service") { openMenu('6'); rubrik = "service"; } }
function standort7(){
openMenu('11'); rubrik = ""; }
function start() { // create menu objects and position them: theMenu[0] = new menuSetup(0,119); theMenu[1] = new menuSetup(1,119); theMenu[2] = new menuSetup(2,119); theMenu[3] = new menuSetup(3,119); theMenu[4] = new menuSetup(4,119); theMenu[5] = new menuSetup(5,119); theMenu[6] = new menuSetup(6,119); theMenu[7] = new menuSetup(7,119); theMenu[8] = new menuSetup(8,119); theMenu[9] = new menuSetup(9,119); theMenu[10] = new menuSetup(10,119);
// show start for (var i=0;i<theMenu.length;i++) { //loop through the array of objects, and show the menus // measure menu theMenu[i].measure(); // show menu theMenu[i].showMenu(); } }
</script>
<style type="text/css">
body {font-family: Arial, sans-serif; font-size: 8pt; font-weight: bold; color: #727272; text-decoration: none; text-align: right;}
.menu { font-family: Arial, sans-serif; font-size: 8pt; font-weight: bold; color: #727272; position: absolute; z-index: 2; width: 150px; cursor:pointer; text-align: right; }
.menudesc { font-family: Arial, sans-serif; font-size: 7.5pt; position: absolute; z-index: 2; visibility: hidden; width: 150px; line-height:15px; cursor:pointer; text-align: right; }
a:active { font-family: Arial, sans-serif; font-weight: bold; font-size: 8pt; color: #727272; text-decoration: none; text-align: right; font-style: normal; } a:hover { font-family: Arial, sans-serif; font-weight: bold; font-size: 8pt; color: #727272; text-decoration: none; text-align: right; font-style: normal; } a:link { font-family: Arial, sans-serif; font-size: 8pt; font-weight: bold; color: #727272; text-decoration: none; text-align: right; font-style: normal; } a:visited { font-family: Arial, sans-serif; font-weight: bold; font-size: 8pt; color: #727272; text-decoration: none; text-align: right; font-style: normal; }
a.submenue:active { font-family: Arial, Helvetica, sans-serif; font-size: 7.5pt; color: #999999; text-decoration: none; text-align: right; font-weight: normal; } a.submenue:hover { font-family: Arial, Helvetica, sans-serif; font-size: 7.5pt; color: #999999; text-decoration: none; text-align: right; font-weight: normal; } a.submenue:link { font-family: Arial, Helvetica, sans-serif; font-size: 7.5pt; color: #999999; text-decoration: none; text-align: right; font-weight: normal; } a.submenue:visited { font-family: Arial, Helvetica, sans-serif; font-size: 7.5pt; color: #999999; text-decoration: none; text-align: right; font-weight: normal; }
</style> </head>
<body onload="start()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- MENU -->
<div id="mainMenu0" class="menu"> <a href="http://www.Firmenname.com/germany/" target="_top" onfocus="this.blur()">Startseite</a> </div> <div id="mainMenu1" class="menu" onClick="standort1()">Unternehmen</div> <div id="mainMenu2" class="menu" onClick="standort2()">Aktuelles</div> <div id="mainMenu3" class="menu" onClick="standort3()">Produktübersicht</div> <div id="mainMenu4" class="menu" onClick="standort4()">Anwendungen</div> <div id="mainMenu5" class="menu" onClick="standort5()">Bezugsquellen</div> <div id="mainMenu6" class="menu" onClick="standort6()">Service</div> <div id="mainMenu7" class="menu" style="margin-top:20px;"><a href="http://www.Firmenname.com/germany/14/" onclick="standort7()" onfocus="this.blur()" target="mainFrame">Suchen & Finden</a></div> <div id="mainMenu8" class="menu" style="margin-top:20px;"><a href="http://www.Firmenname.com/germany/15/" onclick="standort7()" onfocus="this.blur()" target="mainFrame">Rückruf vereinbaren</a></div> <div id="mainMenu9" class="menu" style="margin-top:20px;"><a href="http://www.Firmenname.com/germany/16/" onclick="standort7()" onfocus="this.blur()" target="mainFrame">Allgemeine Anfrage</a></div> <div id="mainMenu10" class="menu" style="margin-top:20px;"><a href="http://www.Firmenname.com/germany/17/" onclick="standort7()" onfocus="this.blur()" target="mainFrame">Impressum</a></div>
<span id="theTip0" class="menudesc"></span> <div id="theTip1" class="menudesc" style="margin-top: -5px;"> <a href="http://www.Firmenname.com/germany/company/4/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Über Firmenname</a><br> <a href="http://www.Firmenname.com/germany/company/1/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Jobs und Karriere</a><br> <a href="http://www.Firmenname.com/germany/company/0/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Presse Forum</a><br> </div>
<div id="theTip2" class="menudesc" style="margin-top: -5px;"> <a href="http://www.Firmenname.com/germany/aktuell/0/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()">Pressemitteilungen<br> <a href="http://www.Firmenname.com/germany/aktuell/1/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Stories</a><br> <a href="http://www.Firmenname.com/germany/aktuell/2/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()">Veranstaltungen<br> </div>
<div id="theTip3" class="menudesc" style="margin-top: -5px;"> <a href="http://www.Firmenname.com/germany/produkte/B/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Für zu Hause</a><br> <a href="http://www.Firmenname.com/germany/produkte/4/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Für kleine Büros</a><br> <a href="http://www.Firmenname.com/germany/produkte/8/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Für Unternehmen</a><br> </div>
<div id="theTip4" class="menudesc" style="margin-top: -5px;"> <a href="http://www.Firmenname.com/germany/6/0/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Kommunikation</a><br> <a href="http://www.Firmenname.com/germany/6/2/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Mobilität</a><br> <a href="http://www.Firmenname.com/germany/6/1/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Organisation</a><br> </div>
<div id="theTip5" class="menudesc" style="margin-top: -5px;"> <a href="http://www.Firmenname.com/germany/vertrieb/4/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Für Kunden</a><br> <a href="http://www.Firmenname.com/germany/vertrieb/5/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Für Fachhändler</a><br> <a href="javascript:win=NewWindow('http://www.Firmenname.com/tpn/0/','register','850','630','no');win.focus()" class="submenue" style="margin-right: 2px" onfocus="this.blur()">Partner-Programm</a><br> </div>
<div id="theTip6" class="menudesc" style="margin-top: -5px"> <a href="http://www.Firmenname.com/germany/service/5/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Support</a><br> <a href="http://www.Firmenname.com/germany/service/6/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Download</a><br> <a href="http://www.Firmenname.com/germany/11/" target="mainFrame" class="submenue" style="margin-right: 2px" onfocus="this.blur()"> Fragen und Antworten</a><br> </div>
<div id="theTip7" class="menudesc"> </div>
<div id="theTip8" class="menudesc"> </div>
<div id="theTip9" class="menudesc"> </div>
<div id="theTip10" class="menudesc"> </div>
<!--MENU ENDE -->
<p style="margin-top: 50px; margin-bottom: 0px"> <img src="if6b80a4-002.apd/1pgrey.gif" width="1" height="2000" align="right">
<table height="100%" width="166" cellpadding="0" cellspacing="0" border="0"> <tr><td valign="top" align="right">
<table border="0" cellpadding="0" cellspacing="0" border=1> <tr><td align="right"><img src="if6b80a4-001.apd/ts-small.gif" hspace="12" vspace="5" width="106" height="20" border=0></td></tr> <tr><td> </td></tr> </table>
</td></tr> </table> </p>
<table><tr><td>
</td></tr></table> </body> </html>
hi,
Hier das komplette Script (in Häppchen, weil sonst zuviel).
deine fehlerbeschreibung ist dadurch noch kein stück aussagekräftiger geworden.
ausserdem hat hier keiner lust, sich ellenlangen scriptcode anzusehen.
isoliere also die problematische stelle(n), reduziere den code auf die für das problem wesentlichen passagen, verfasse eine _vernünftige_ fehlerbeschreibung, und komme dann damit wieder.
gruss,
wahsaga
Hallo,
woher soll ich wissen welche Passagen was mit dem Problem zu tun haben. Das einzige was ich weiss ist, dass wenn jemand von ausserhalb das Script öffnet bekommt er sofort, oder bei Klick auf die Untermenüs undefined=undefined.
Wenn du das Script rauskopierst und bei dir im Browser ausprobierst, funktioniert ja alles.
Kann es denn dann überhaupt am Script liegen oder hat das was mit Einstellungen am Firmenserver zu tun?
Hallo,
woher soll ich wissen welche Passagen was mit dem Problem zu tun haben. Das einzige was ich weiss ist, dass wenn jemand von ausserhalb das Script öffnet bekommt er sofort, oder bei Klick auf die Untermenüs undefined=undefined.
Ich will ja nicht meckern, aber wen du in der Lage bist solche Mammutskripte in deine Seite einzubinden, solltest du wenigstens Grundlagen beherrschen um Skripte zu debuggen.
Wenn du das Script rauskopierst und bei dir im Browser ausprobierst, funktioniert ja alles.
Du erwartest zuviel, hier ist kein kostenloses Supportforum.
Dein Problem tritt an einer ganz bestimmten Stelle im Skript auf, d.h. du könntest wissen was das Problem verursacht und dein Skript soweit kürzen das der Fehler auftritt ohne das du uns hier alles vorwirfst.
Ich weiß nicht ob du das verstehst, aber bevor sich andere um das debuggen deines Skriptes kümmern, solltest du ein wenig Eigenleistung zeigen, das erhöht die Bereitschaft andere dir dabei zu helfen. Bis jetzt habe ich zumindest nicht den Eindruck, dass du das tust.
Kann es denn dann überhaupt am Script liegen oder hat das was mit Einstellungen am Firmenserver zu tun?
Nein.
Ich habe dir bereits einen Hinweis gegeben woran es liegen könnte, was haben deine diesbezüglichen Nachforschungen ergeben?
Struppi.
Hallo
Ausserhalb der Firma bekommen die Leute anzeigt "undefined=undefined" oder "undefined is undefined", hier funktioniert es aber reibungslos, auf jedem Rechner. Woran kann das liegen?
<glaskugelmodus>
Du kannst erst auf die Seite zgreifen, wenn sie fertig geladen ist.
</glaskugelmodus>
Und in Zukunft diese Tipps beherzigen:
http://glasgoogle.de
Struppi.