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, 04: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: 7
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, 610 views)

Reply With Quote
  #2  
Old April 21st, 2003, 06:53 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,058 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, 12: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: 7
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, 12:53 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,058 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, 01: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: 7
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, 504 views)

Reply With Quote
  #6  
Old April 22nd, 2003, 01:16 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,058 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, 01: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: 7
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


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




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

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




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek