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:
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  
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: 6
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, 384 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
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Maybe it's just me, but there are no files in the zip.

Why don't you explain briefly what your problem is.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

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: 6
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
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
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: 6
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, 280 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
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
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: 6
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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway