ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 10th, 2003, 08:55 AM
ph00ey ph00ey is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 ph00ey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question js & vb script on same page ?

Evenin' all !

Am currently trying to incorporate a nice client-side tree navigation menu into a large extant codebase written in asp with vbscript used as main body of client-side validation etc.
My problem is that the tree-view (like most nice bits of code out there !) is written in javascript...

When I attempt to instantiate the treeview object from it's protoypes in the '.js' I simply get a client-side error informing me that 'obj' is undefined (where 'obj' = the name of my treeview prototype function....

I'm right in thinking that javascript and vbscript can reside successfully on the same .asp page, so how come this darn function call fails ?!

<begin code>

<script language="javascript" type="text/javascript" src="dtree.js"></script>

<script language="javascript" type="text/javascript">
<!--
t = new objTree(t);
d.add (2649187, 0, 'Unknown Reportees','', '','','img/globe.gif', 'img/globe.gif');
....
....
</end code>

Error occurs on the 't = newobjTree(t)' line

Any thoughts gratefully accepted...

Yours in jscript hell
Scott

Reply With Quote
  #2  
Old November 10th, 2003, 09:02 AM
DarrellMe DarrellMe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Birmingham, England
Posts: 7 DarrellMe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi

JS and VB can both reside on the same page as client side scripts, and VB can call JS functions. I am not too sure as to whether VB can actually instantiate JS objects, but without seeing the JS code in the .js file I cannot see what you are trying to do.

However, I would also recomment that you use Javascript client side at all times. The main reason for this is so that your web pages are not restricted to IE.

Let me know if you need any more help

Darrell

Reply With Quote
  #3  
Old November 10th, 2003, 09:38 AM
ph00ey ph00ey is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 ph00ey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up re...js & vbscript

Hi Darrell,

thanks for the response. I know about the question of vbscript & browser compatibility but the application is within an intranet and our core build on machines means IE5 only !

Here's the calling code
<script language="javascript" type="text/javascript">
<!--
t = new dTree('t');
t.add (2649187, 0, 'Root','', '','','inc/tree/img/globe.gif', 'inc/tree/img/globe.gif');
t.add (-2, 0, 'Unknown Reportees','', '','','inc/tree/img/question.gif', 'inc/tree/img/question.gif');
t.add (-1, 0, 'Recycle Bin','', 'Drop here to remove ','','inc/tree/img/trash.gif', 'inc/tree/img/trash.gif');

document.write(t);
//-->
</script>

The error I now receive is 'cannot use parentheses when calling a sub' which is a vbscript error, yet I've narrowed the issue to the lines in which i do a t.add(..) in side the javascript tags !?

very bemused ! Have attached the .js for completeness.
Cheers Darrell
rename to "dtree.js" ...TIA

Scott
Attached Files
File Type: txt dtree.js.txt (20.7 KB, 215 views)

Reply With Quote
  #4  
Old November 10th, 2003, 01:03 PM
DarrellMe DarrellMe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Birmingham, England
Posts: 7 DarrellMe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi

I have managed to get some code working with this. I would think that the main problem is being able to either

1) access the dtree.js
2) find the dtree.js

Have a look at the zip file, which contains an ASP page, and all of the folder structure for a working tree. The dtree.js is smaller than the one that you sent to me, but I downloaded one from the site mentioned in the top of the js file you sent to me

Let me know if you need any more help

Darrell
Attached Files
File Type: zip test.zip (12.9 KB, 225 views)

Reply With Quote
  #5  
Old November 11th, 2003, 07:21 AM
ph00ey ph00ey is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 ph00ey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking js & vb script on same page ?

Yay !

Finally got it working again
Thanks for trying Darrell...turned out it was the state of the client-side script in a big include that goes at the top of all pages in our application...script in there was all over the place ! Tidied it up and put it into the <HEAD> tag then re-created my tree again from the db and it's now operational and dragging 'n dropping like a good 'un !

Thanks for taking the time to look into this.

Best Regards
Scott

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > js & vb script on same page ?


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 | 
  
 





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