Quote:
quote:Originally posted by planoie
This looks fine to me. What is the error? Are you getting javascript errors? Could the problem be the URL? Is that URL relative to the ASP.NET application or is that URL relative to the server root?
|
Hello friend,
The url is a JScript file which is located on different virtual directory on the same server.I am not getting any javascript errors the only thing is
JS file is a menu file which is not displaying in my .Net page.One more important thing this is a converted page from asp to asp.net.
Can u please tell me whether my script tag is correct or not?
The
JS File contains The below matter please dont get confused...
//--------------------------menus--------------------------------------------------------------
var menublock=new Array() // no need to change this
var plus_i=0 // no need to change this
menublock[0]="verdana;"+ // font mainlink
"1;"+ // fontsize mainlink
"#00008B;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
"Verdana;"+ // font sublinks
"1;"+ // fontsize sublinks
"#483D8B;"+ // fontcolor sublinks
"0;"+ // fontweight sublinks, 1 means bold, 0 means normal
"Jobs/Tasks |#|;"+ // text|URL|target of mainlink
"Add New Tasks| AddNewTask.asp;"+ // text|URL|target of first sublink
"Submit Task Sheet| Displaytasksheet.asp;"+
"Previous Day Task Sheet| PreviousDayTasksheet.asp;" +
"Assigned Activity| SETask.asp;" +
"Other Jobs of the Day|OtherJobs.asp;" +
"Previous Day Jobs|Previousjobs.asp;"
menublock[1]="verdana;"+ // font mainlink
"1;"+ // fontsize mainlink
"#00008B;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
"Verdana;"+ // font sublinks
"1;"+ // fontsize sublinks
"#483D8B;"+ // fontcolor sublinks
"0;"+ // fontweight sublinks, 1 means bold, 0 means normal
"My Reports |#|;"+ // text|URL|target of mainlink
"My Jobs| MyJobs.asp;"+ // text|URL|target of first sublink
"My TS Report| MyTSReport.asp ;"+
"Task Sheet Report| EmpTaskSheetReport.asp ;"+
"Mark My Tour| MarkMyTour.asp?level=adm ;" +
"Manage My Tour| ManageMyTour.asp ;"
menublock[2]="verdana;"+ // font mainlink
"1;"+ // fontsize mainlink
"#00008B;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Reserve Conference Hall| ConBook.asp ;" // text and URL of mainlink
menublock[3]="verdana;"+ // font mainlink
"1;"+ // fontsize mainlink
"#00008B;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Change Password| changePwd.asp ;" // text and URL of mainlink
menublock[6]="verdana;"+ // font mainlink
"1;"+ // fontsize mainlink
"#00008B;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Logout| LogoutProcess1072MACActual.asp target='_top';" // text and URL of mainlink
menublock[5]="verdana;"+ // font mainlink
"1;"+ // fontsize mainlink
"#00008B;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Library Books| DisplayBook.asp target='_top';" // text and URL of mainlink
menublock[4]="verdana;"+ // font mainlink
"1;"+ // fontsize mainlink
"#00008B;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Help| Help.doc target='new';" // text and URL of mainlink
// No need to change anything below
// ************************************************** ********************************
var menusplit
var urlsplit
var font_weight_main
var font_weight_sub
var font_weight_sub
var minusimg=new Image()
minusimg.src="m.gif"
var plusimg=new Image()
plusimg.src="p.gif"
var showsubmenus=new Array()
for (i=0;i<=menublock.length-1;i++) {
showsubmenus[i]=-1
}
var plusminusimg=new Array()
for (i=0;i<=menublock.length-1;i++) {
plusminusimg[i]=plusimg.src
}
function modi(visi)
{
//alert(visi);
//alert(showsubmenus[visi]);
//alert(showsubmenus[1]);
if(visi==0)
{if(showsubmenus[1]==1)
openandclose(1);
if(showsubmenus[2]==1)
openandclose(2);
if(showsubmenus[3]==1)
openandclose(3);
}
if(visi==1)
{if(showsubmenus[0]==1)
openandclose(0);
if(showsubmenus[2]==1)
openandclose(2);
//if(showsubmenus[3]==1)
//openandclose(3);
}
if(visi==2)
{if(showsubmenus[0]==1)
openandclose(0);
if(showsubmenus[1]==1)
openandclose(1);
if(showsubmenus[3]==1)
openandclose(3);
}
if(visi==3)
{if(showsubmenus[0]==1)
openandclose(0);
//if(showsubmenus[1]==1)
// openandclose(1);
if(showsubmenus[2]==1)
openandclose(2);
}
openandclose(visi);
}
function openandclose(visi) {
showsubmenus[visi]=(-1)*showsubmenus[visi]
var menucontent=""
if (showsubmenus[visi]==1) {plusminusimg[visi]=minusimg.src}
if (showsubmenus[visi]==-1) {plusminusimg[visi]=plusimg.src}
menucontent+="<table border=0>"
for (i=0;i<=menublock.length-1;i++) {
menusplit=menublock[i].split(";")
urlsplit=menusplit

.split("|")
if (menusplit[3]==1) {font_weight_main="<b>"}
if (menusplit[3]==0) {font_weight_main=""}
if (menusplit[7]==1) {font_weight_sub="<b>"}
if (menusplit[7]==0) {font_weight_sub=""}
menucontent+="<tr><td>"
if (menusplit[9].length==0) {
menucontent+="</td>"
menucontent+="<td>"
menucontent+=font_weight_main
menucontent+="<a href="+urlsplit[1]+">"
menucontent+=""
menucontent+=urlsplit[0]
menucontent+="</a></td></tr>"
plus_i++
}
if (menusplit[9].length!=0) {
var thismainmenu=i+plus_i
menucontent+="<a href='javascript
:modi("+i+")'>"
menucontent+="<img src='"+plusminusimg[i]+"' border=0></a></td>"
menucontent+="<td>"
menucontent+=font_weight_main
menucontent+="<a href='javascript
:modi("+i+")'>"
menucontent+=""
menucontent+=urlsplit[0]
menucontent+="</a></td></tr>"
if (showsubmenus[i]==1) {
for (ii=9;ii<=menusplit.length-1;ii++) {
urlsplit=menusplit[ii].split("|")
menucontent+="<tr><td></td><td>"
menucontent+=font_weight_sub
menucontent+="<a href="+urlsplit[1]+" >"
menucontent+=""
menucontent+=urlsplit[0]
menucontent+="</a></td></tr>"
}
}
}
}
menucontent+="</table>"
if (document.all) {
menu.innerHTML=menucontent
}
if (document.layers) {
document.menu.document.write(menucontent)
document.menu.document.close()
}
}
// - End of JavaScript - -->