Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question on javascript java objects
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Question on javascript java objects
Divers
Thread ID:
00994534
Message ID:
00994534
Vues:
56
I expected this code to work but ie messages that cmi.course is null or not an object. I was really interested in the "status" string assignment
<!---- jot1.htm ---- test object constructs -->
<html><head>
<script language="javascript">
cmi=new Object();
this.course = new Object();
cmi.course.status="cmi.course.status";
alert("cmi.course.status = " + cmi.course.status);
</script></head><body><form></form></body></html>
This one works - but it takes a little more thought and code:
<!---- jot2.htm ---- test object constructs -->
<html><head>
<script language="javascript">
function status_property(){This.status = "The value of the status";}
courseNode = new status_property();
function course_container(){this.course = courseNode;}
cmi = new course_container();
alert("cmi.course.status = +cmi.course.status);
</script></head><body><form></form></body></html>
The "status will eventually point to a function and / or a INPUT form control. It just seems that the top snippet (jot1) should work. Eventually, a "naive" html will need to cycle through the frames and locate the "API" that will include the "cmi" objects - but that is naother question.
Thanks
Imagination is more important than knowledge
Répondre
Fil
Voir

Click here to load this message in the networking platform