JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 21st, 2003, 05:09 AM
pgokcen pgokcen is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 44 pgokcen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 29 sec
Reputation Power: 15
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....
Attached Files
File Type: zip mnu.zip (6.1 KB, 972 views)

Reply With Quote
  #2  
Old April 21st, 2003, 07:53 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
Maybe it's just me, but there are no files in the zip.

Why don't you explain briefly what your problem is.

Reply With Quote
  #3  
Old April 22nd, 2003, 01:41 AM
pgokcen pgokcen is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 44 pgokcen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 29 sec
Reputation Power: 15
Question Explaining problem

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

Reply With Quote
  #4  
Old April 22nd, 2003, 01:53 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
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?

Reply With Quote
  #5  
Old April 22nd, 2003, 02:10 AM
pgokcen pgokcen is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 44 pgokcen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 29 sec
Reputation Power: 15
Question Nothing happens

Hi;

I am writing the code attached but nothing happens on page?
trial.asp
Attached Files
File Type: zip trial.zip (936 Bytes, 826 views)

Reply With Quote
  #6  
Old April 22nd, 2003, 02:16 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
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") %>

Reply With Quote
  #7  
Old April 22nd, 2003, 02:25 AM
pgokcen pgokcen is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 44 pgokcen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 29 sec
Reputation Power: 15
error

Hi;

<% response.write ("menu.addSubMenu(new PopUpMenuItem("Project1",GetSub("D:\")))") %>

gives error on this line
says: ')' expected???

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Trouble in algorithm of script


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap