My problem is this; the <body> tag does not seem to pass the "id" value but rather the name of the application. I am using fireFox.
In this example the obj parameter becomes "appName.exe". And when I try to use the id in the function addScratchPad(obj) like this
var cThisApp = obj.id
I get an "undefined" error.
I want to use the id value to insert the scratchPad into the document like this
document.getElementById(cThisApp).innerHTML = "<div>.... other conten.. </div>
Here is my code:
Expand|Select|Wrap|Line Numbers
- <HEAD>
- <TITLE> dailyTimeReview </TITLE>
- <script type="text/javascript" language="JavaScript" src="Navigation.js"></script>
- <script language="JavaScript">
- <!--])
- function myStartUp(obj)
- {
- addScratchPad(obj);
- aDepts = cMyDepts.split('~');
- }
- //-->
- </script>
- </HEAD>
- <body
- id ="testForm"
- onLoad = "myStartUp(this);"
- >
Expand|Select|Wrap|Line Numbers
- function addScratchPad(obj)
- {
- //this next line fails
- alert(obj.id);
- }