|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > js & vb script on same page ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|