Click here to Skip to main content
15,896,726 members
Articles / Web Development / HTML

A Reusable Framework for Connecting Both WebHelp and Compiled Help RoboHelp Projects to Relational Databases Through the Use of JavaScript Object LIterals

Rate me:
Please Sign up or sign in to vote.
2.60/5 (4 votes)
10 May 200518 min read 45.7K   319   16  
This article will describe how to hook up RoboHelp projects to a database to provide data to pages for both WebHelp and Compiled Help using a single architecture. The implementation will rely on the JavaScript interpreter built into almost all web browsers and that is available in Compiled Help too.
		<html>
		<head>
		<title>International Staffing Company</title>
		<script type="text/javascript" src='DynamicPage_data.js'></script>
		<script type="text/javascript"
		style="x-condition: ONLINE_ALL"
		src="http://localhost/robohelp/generatedata.asp?cmdSet={vnam:'myData',func:'GetListValues',arg:[1,2,3]},{vnam:'myContact',func:'GetContactInfo',arg:null}"></script>
		<script type="text/javascript" src='applicationcontroller.js'></script>
		<script type="text/javascript">
		<!--
		var MyApp = new MyHelpApplicationController(MyHelpApplicationController.DEPLOYMENT_ENUM.PRODUCTION);
		// -->
		</script>

		<style type="text/css">
		<!--
		BODY {
			font-family: arial;
			font-size: 80%;
		}
		H3 {
			color: navy;
		}
		LI {
			list-style: disc;
		}

		/* works in FireFox, but not IE:
		LI:before {
			content: '> ';
			font-weight: bold;
			color: navy;
			font-size: 85%;
		}
		*/

		// -->
		</style>
		<script type="text/javascript">
		<!--
			function RenderList(id) {
				var rv = "<ul>\n";

				var obj = myData[id];

				for (var i in obj) {
					rv += "\t<li>" + obj[i].lookup_desc + "</li>\n";
				}

				return rv + "</ul>\n";
			}

			function RenderContactInfo() {
				var rv = "<div>\n";

				for (var i = 0; i < myContact.length; i++) {
					var rec = myContact[i];
					rv += "<b>" + rec.Label + "</b> : " + rec.Value + "<br />\n";
				}
				return rv + "</div>\n";
			}
		// -->
		</script>

		<body>

		<h2>Welcome to International Staffing Company Web Help</h2>

		<p>This site provides information about navigating our web site and using our online services.</p>

		<h3>ICS fills positions for the following job types:</h3>
			<script type="text/javascript">
			<!--
			document.write(RenderList(1));
			// -->
			</script>
		<h3>ICS has placed people in the following industries world wide:</h3>
			<script type="text/javascript">
			<!--
			document.write(RenderList(2));
			// -->
			</script>
		<h3>ICS has worked with companies in the following countries:</h3>
			<script type="text/javascript">
			<!--
			document.write(RenderList(3));
			// -->
			</script>
		<h3>Contact ICS</h3>
		Feel free to contact us!<br /><br />
			<script type="text/javascript">
			<!--
			document.write(RenderContactInfo());
			// -->
			</script>
		<br />
		<a href="javascript:void(alert(MyApp.baseUrl))">Show Base Url</a>
		</body>
		</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions