Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new to java script (not to programming) Help with back/next navigation

Status
Not open for further replies.

Insider1984

Technical User
Joined
Feb 15, 2002
Messages
132
Location
US
Hello everyone. I'm not new to programming but this is my first post in the javascript forum as I'm new to writing my own java script. My past experience has pretty much been modding correctly working java script.

anyway my question. I have a working menu system using a js file with the following inside of it:

Code:
/* Vision Menu items structure */
var MENU_ITEMS = [
	['Vision Basics', null, null,
		['Introduction', null, null,
			['Acronyms', '1-1.html'],
			['Terms', null],
			['Save Values', null],
			['Part Files Structure', null],
			['Image Naming Format', null],
			['Vision System Overview', null],
			['ImageJ/Matrox', null]
		],
		['CAD Files', null, null,
			['CAD File Locations', null],
			['DXF', null],
			['Modifications Needed', null],
			['Troubleshooting Common Errors', null]
		],
		['Vision Editor', null, null,
			['mini', null],
			['cad', null],
			['dxfx', null],
			['pini', null],
			['Field Of View Layout', null],
			['Placing Inspection Windows', null],
			['Scripts', null],
			['Masks', null],
			['Nominals', null],
			['Synthetics', null]
		],
		['Part File Cleanup', null, null,
			['remove tests without masks', null]
		],
		['Synthetic Images', null, null,
			['No Errors', null],
			['No Clipping', null],
			['Full Part Coverage', null],
			['All Edges Train', null],
			['Masks Are Places Correctly', null]
		]
	],
	['Advanced', null],
	['Expert', null]
];

It's pretty basic. The java script just makes a neat little menu from it. I use it currently to allow non programmers to make their own menus.

I'd like to extend the functionality of this one more by adding a next and back button either on the menu or at the bottom of the page that can help go "back" and "forward" through the list.

Seems like it should be fairly easy but without debugging (like I'm used to in C# for example) I don't have the confidence to just tinker until I understand and find the solution.

Please help if you can. Thanks!

=====================
Insider
4 year 'on the fly' programmer
C++ Basic Java
 
But what is your actual problem? How are you stuck with the coding? Do you have errors, or are you after general pointers on how you might navigate through a 2D array?

but without debugging

Then get a JS debugger! One comes free with Firefox, MS offer a free downloadable one, and you've always got the likes of MS Visual Interdev, too - and that's just 3 off the top of my head - there are probably more if you look around.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Insider1984 said:
I don't have the confidence to just tinker until I understand and find the solution.

It's very easy to do little JavaScript tests. I am constantly writing files called test.html with very minimal HTML in it to test an easy script:

Code:
<html>
<head>
<script>
function blahblah(arg1, arg2)
{
 //do something
}
</script>
</head>
<body>
<input type='button' value='click me' onclick='blahblah(1, 2)' />
</body>
</html>

Get over your fears! You will not break your computer! :)

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top