|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Trouble in algorithm of script
Hi;
Please view the attached file I need really help I would be very happy if you help me Thanks.... |
|
#2
|
||||
|
||||
|
Maybe it's just me, but there are no files in the zip.
Why don't you explain briefly what your problem is. |
|
#3
|
|||
|
|||
|
Hi;
Thank you firstly for helping me I am trying to develolp a web application which provides a rapid access to the project documentation files on server.In my server,I have several projects in folders Project1 Project2 ............. And there are also folders under it nested (2,3 or 5 levels).For example the hierarcy is Project1 ............\Sub1 .............\Sub2 .....................\Sub1_1 ......................\Sub1_2 .......................\Sub2_1 ........................\Sub2_2 ....................................\Sub1_1 .................................................\ xxx.doc .................................................. \yyy.doc Now I have a page,I list all these folder names on that page.(The folder structure all same for the projects so this page resembles to a template also,some folders may differ,so I didn't write them down below like Sub1_1 vs....),like this: -Sub1 -Sub2 ......... Now think that I have 5 projects Project1,2,3,4 and 5 When I come over Sub1 link on page,a menu must appear showing the project names Project1 Project2 Project3 Project4 Project5 Now when I come over Project1,the folder names under Sub1 folder(which is the link name) must appear as a submenu.Which is Project1--->Sub1_1 Sub1_2 If I come over Sub1_1 submenu item,then another submenu must appear showing the subfolders of Sub1_1 which then Project1-->Sub1_1-->Sub1_1_1 Sub1_2 I hope it is clear.Now I have 2 java scripts for the menu.There are functions like new PopUpMenu new PopUpMenuItem("<name>","<link>") menu.addItem menu.addSubMenu(new PopUpMenuItem("<name>",submenu) Note that you give the name of the main menu item at the same time with the submenu that will appear under it) ..... etc I am trying to write a set of functions that will do the above.I wrote: <script type="text/javascript" language="JavaScript"> function CreateMainMenu(){ response.write "var menu=new PopUpMenuItem(180)"; response.write "menu.addSubMenu(new PopUpMenuItem("Project1",GetSub("D:\Project1"))"; response.write "menu.addSubMenu(new PopUpMenuItem("Project2",GetSub("D:\Project2"))"; } function GetSub(path){ <% set fs=CreateObject("Scripting.FileSystemObject") set folder=fs.GetFolder(path) set subfolders=folder.SubFolders %> response.write "var submenu=new PopUpmenuItem(180)"; <% for each subfolder in subfolders %> if(subfolder contains folders ????)//how can I write that response.write "submenu.addSubMenu(new PopUpMenuItem(<% subfolder %>,GetSub("path\<% subfolder %>")"; else response.write "submenu.addItem(new PopUpMenuItem(<% subfolder %>,"#")"; end if <% next %> return submenu; } But is it true?I do not think so I know it is too long but????? Thanks very much You can find scripts div_menu.js menu_basics.js on URL: http://www.js-examples.com/js/menu.tar.gz |
|
#4
|
||||
|
||||
|
So, you need a recursive function that checks for sub folders - you code looks pretty good so far. Are you having a logic or syntax problem?
|
|
#5
|
|||
|
|||
|
Hi;
I am writing the code attached but nothing happens on page? trial.asp |
|
#6
|
||||
|
||||
|
you seem to be trying to write to the page like this:
<% response.write %> "foo" As far as i know - that won't do anything. It should look like this <% response.write("foo") %> |
|
#7
|
|||
|
|||
|
error
Hi;
<% response.write ("menu.addSubMenu(new PopUpMenuItem("Project1",GetSub("D:\")))") %> gives error on this line says: ')' expected??? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Trouble in algorithm of script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|