Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 9th, 2003, 05:03 PM
Authorized User
 
Join Date: Oct 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using VBScript and JavaScript together

All,

This is rather a complex question... I am hoping someone can help me... I have written a recursive function in VBScript that builds a dynamic tree from our SQL database. I don't know JavaScript very well, so I've downloaded code to help in building a collapsible tree structure without refreshing the page. I'm having a little trouble figuring out how to port my nicely formed tree into JavaScript.

Basically, the JS code I'm using makes use of functions and methods so that the tree is built similar to this:

level1ID = theMenu.addEntry(-1, "Folder1");
level2ID = theMenu.addChild(level1ID, "ChildObject1");
level2ID = theMenu.addEntry (level2ID, "ChildObject2");
level2ID = theMenu.addEntry(level2ID, "Folder");
level3ID = theMenu.addChild(level2ID, "Document");

I'm not sure how best to interface my recursive code with the above code to build a dynamic, data-driven solution.

Any ideas?

(If it means anything to anyone, I'm using "Joust" for my collapsible tree. Also, I'll freely send my code to anyone willing to help.)
 
Old October 12th, 2003, 12:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

Hi.
I found two similar questions, maybe these can help you
Similar problem: http://p2p.wrox.com/topic.asp?TOPIC_ID=4209

This got a lot of answers: http://p2p.wrox.com/topic.asp?TOPIC_ID=3608
;)
Regards - Jon
 
Old October 13th, 2003, 10:06 AM
Authorized User
 
Join Date: Oct 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

All,

Just FYI - I ended up using a VBScript code tag inside the JavaScript function to build the code dynamically. This is the very first thing I tried and I received an error to the effect of "cannot place one code block inside of another", but a fellow programmer here at M2M told me to use this solution and wrote an example that worked.

I honestly have no idea what the difference was... But building the code dynamically simplified the process greatly. (See below)

<%
Response.Write("level"& arrJSLevel(i) &"ID = theMenu.addEntry(level"& arrJSLevel(i) &"ID, """ & arrJSValueOne(i) & """, """& arrJSValueTwo(i) &""", """& arrJSValueThree(i) &""", """& arrJSValueFour(i) &""");" & vbCrLf)
%>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert JavaScript OK/CANCEL to VBScript timmerdfw VBScript 0 January 4th, 2007 03:42 PM
JavaScript to VBScript Thomas82 Classic ASP Basics 1 July 29th, 2006 07:03 PM
Javascript and VBScript woes 1up Javascript How-To 18 November 7th, 2005 03:18 PM
Using VBScript variables in Javascript PL Classic ASP Basics 4 July 29th, 2004 03:05 PM
vbscript and javascript together erin VBScript 1 October 21st, 2003 02:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.