Captivate 9, fully updated.
HTML5 output only.
I have Captivate slide accessed from our training server.
The slide has a WebObject that displays information from a hospital Patient System on a different server.
(I have no control over the Patient System, it is created and managed by a third party.)
As a student task I need the student to browse the patients in the WebObject, and then click the Task Finished button on the slide.
When Task Finished is clicked, I need to identify the PatientID so that I can use it in Captivate.
The PatientID is always located in the HTML code <label id="PatientID">ABC123</label>
I know how to create all of this in Captivate.
What I would appreciate is for just a quick and dirty pointer as to how to start this.
(The URLs in the image below are dummies just for example.)
Create a variable in Captivate where you want to store the ID;
var getFrame = document.getElementsByTagName("IFRAME");var elem = getFrame.contentWindow.document.getElementById("PatientID");
window.yourVariable = elem.innerHTML;
Change yourVariable to the variable you create.
Note: You may run into CORS issues.
Thank you, your code worked perfectly, and as you predicted I ran into the CORS issue.
Unfortunately the website I want to put in a frame is on a different domain to me, and it uses the HTML shown below, and I guess that means I can't do what I am attempting.
<meta http-equiv="X-Frame-Options" content="SAMEORIGIN" />
Once again, thank you for you help, it is always much appreciated.
Note to anyone who wants to use this code: getElementById"PatientID"); was missing a bracket getElementById("PatientID");
Is Patient Systems a client?
It would be very easy for them to add your URL to allow access.
The patient system in a national system for the entire country, holding millions of patient records.
It is designed and maintained by a totally independent third party, and is nailed down with an abundance of security.
I know that if I put in a request for my URL to be allowed access for training purposes, it would be refused for very good reasons, as the more holes a system has then the less secure it is.
The onus is on me to think of an alternative method of achieving my goal, and I am some way towards that at the moment.