JavaScript in Captivate 9 project does not run

I tried for hours to get little JavaScript inside an Adobe Captivate 9 (published in SWF and HTML5), deployed to a web server public project, to run. For help troubleshooting, I wrapped in various stages of the script with console.log ("status"); and even those who are not running.

A demonstration project file is located here: https://dl.dropboxusercontent.com/u/6787201/Test%20Interaction%20Data%20HTML5/Test-Interac tion - Data .cptx

If you look at the JavaScript window, you will notice there is a function call to sendInteractionData();

This is a custom function to trigger the data in various Captivate variables in a Google spreadsheet, I wrote. It is contained in the index.html page I change after publication. I tested this feature and it works when the values are explicitly defined and sendInteractionData() is called from a static web site... but when it is embedded in the code JavaScript of Captivate, no luck.

If you are interested, here is the code I have insert to support the sendInteractionData() function:

Configuration section

Paste the URL of the WEB service (obtained after you run the command POST > DEPLOY AS WEB APP) in the variable below!

var WebServiceURL = "mywebserviceurl";

Do not edit below this line, unless you intend to change the inner workings of the script

Declaring variables

var FirstName;

var name;

var Email;

var attribute;

Function to send data to interaction in the Google spreadsheet. This function must be called by the Captivate player after setting the variables above.

function sendInteractionData() {}

Get and set the relevant data from the Captivate player

FirstName = window.cpAPIInterface.getVariableValue('cpFirstName');

LastName = window.cpAPIInterface.getVariableValue('cpLastName');

Email = window.cpAPIInterface.getVariableValue ('cpEmail');

Attribute = window.cpAPIInterface.getVariableValue ('cpAttribute');

Send the data to the Google map via AJAX call

request = $.ajax({)

URL: WebServiceURL,

type: 'post',

data: "FirstName =" + FirstName + "& LastName =" + LastName + "& Email = ' + Email + ' & attribute ="+ attribute.

});

Reminder Manager who will be called to success

Request.Done (function (response, textStatus, jqXHR) {}

Save a message to the console

Console.log ("wrote interaction data sheet: FirstName =" + FirstName + "& LastName =" + LastName + "& Email =" + Email + "& attribute =" + attribute + "/ / Message: success!");

});

Reminder Manager who will be called if an error occurs

Request.Fail (function (jqXHR, textStatus, errorThrown) {}

Logs the error in the console

Console.Error)

"Interaction data could not be saved: FirstName =" + FirstName + "& LastName =" + LastName + "& Email = ' + Email + ' & attribute = ' + attribute + ' / / The following error occurred: ' +"

textStatus, errorThrown

);

});

}

PS - declaration of a Google spreadsheet should really be standard features now...

Thanks for your help.

You really use the listener attached to the window module ready event to ensure that the API is present.

var interfaceObj, eventEmitterObj;

window.addEventListener ("moduleReadyEvent", function (e)
{
interfaceObj = e.Data;
eventEmitterObj = interfaceObj.getEventEmitter ();
initializeEventListeners();
});

function initializeEventListeners()

{

If (interfaceObj)

{

If (eventEmitterObj)

{

window.cpAPIEventEmitter.addEventListener ("CPAPI_VARIABLEVALUECHANGED", function)

{

sendInteractionData(); }, 'cpAttribute '.

);

}

}

}

Tags: Adobe Captivate

Similar Questions

  • JavaScript added with advanced actions does not run in LMS

    I am working on a custom navigation bar which is controlled by Javascript, I added using advanced in Captivate 9 actions. It works very well in tests, but during the loading of our LMS and SCORM cloud custom JS doesn't load or is ignored for some reason any. I'm missing something in my publication settings. It is located on SCORM 2004 v3.

    I was aiming for incorrectly, try now. Usually the case, ask for help and you find the answer yourself. Laughing out loud

  • I have a html file and in it, I have a PHP contact form. However, the html code does not run php. pls help... Thank you

    I wrote a simple html Web page with menus and pull-down (using Dreamweaver) which also includes a contact form. The contact form is in PHP. However, when I run the html file, all right and that the contact form appears, however, she does not run PHP code. Do I have to make any changes of setting or download all the files? Thank you very much

    If you run your own apache server, then you need also a mail server, but if you use a hosted service then your host should have the scripts and HTML on their Web site.  Otherwise, you can use Wufoo free version and you can create your own form and code (JavaScript) that can be integrated into your HTML page. I used Wufoo in Joomla sites and it works very well.

  • Custom calculation does not run in Firefox

    I have a custom in my pdf (Adobe XI) calculation script:

    var v = this.getField("DefendantListBox").value;

    If (typeof v is 'chain')

    Event.Value = v;

    on the other

    Event.Value = v.join ("\n");

    The script runs without problem on my desktop (windows).  When I embed the pdf document in my web application via Firefox (33.1.1), the script does not run.

    I am at a loss on how to enable the Adobe Javascript in Firefox.

    There is a kind of corruption. I suggest you remove the text fields and re-create, possibly under a new name, and then copy the same code in them. When I do this, it works as it should.

    Remember, however, that because the Multiple selection option is checked for list field, that value will be updated as soon as you exit the field, not at the time change you the selection.

  • first items 12, new installation, serial No. accepted, installed and started again, but does not run. I get the following msg-box: ' LoadLibrary failed with error 126: Das angegebene Modul wurde nicht found.»

    first items 12, new installation, serial No. accepted, installed and started again, but does not run. I get the following msg-box: ' LoadLibrary failed with error 126: Das angegebene Modul wurde nicht found.»   Installation in German on WIN7 64 bit professional, Samsung SSD. What can I do to run this program?

    Jürgen Freund

    First 12 items on Window 7 64-bit. What card card video/graphic fact your computer use - AMD Radeon?

    I found this YouTube video about the error 126 precisely to solve the problem.

    How to fix the ERROR 126 when you open programs OpenGL - YouTube

    The link was provided in an old thread from 2013 here by the ID danneomarre (see post 6 of the next thread)

    LoadLibrary failed with error 126: could not find the necessary

    Please let us know if it worked for you.

    Thank you.

    RTA

    Add on... When everything is OK and work, update the 12 to 12.1 update using Help Menu/implementation of an open project.

  • Open the other projects - does not work

    Hello-

    We just finished a lesson of the CBT in the 3 Hat, which includes 29 separate projects. At the end of each project, the student is introduced a button to bring to the next, that is 'open another project '.

    That is the question, we have put this button 'Open another project' and 'open a URL or file '. In both cases the next project does not open. The user is taken to a page of internet search. We have implemented the system of 'Success' button using the Captivate files help where it tells remove you all the ways of the system and just use the names of file or project. Button settings in Advanced Interaction also confirmed.

    We publish our projects in .exe format. This concern is present when we listen to extracts using the feature overview and products .exe.

    What we're doing wrong, any ideas?

    Rick - your basic source code provided us the answer. We made a comparison and found verified the following on all of our projects:

    Under preferences - project - beginning and end
    Start of project options:
    Loading screen:

    This has been verified with blank if Cape tried to start the next project with a blank so it is lacking for a web search page.

    Thank you, SO MUCH

    Mike

  • the component business project does not contain a valid connection

    Hello

    I get this warning appearing in my project when I run:

    WARNING: env_appln: the business component project does not contain a valid connection

    env_appln is the name of my project

    No one knows what it is and how I would go about fixing of this?

    Thank you
    -Mark

    Mark,
    It just tells you that the DB connection that is used in conjunction with the application module is not correctly configured (wrong username or wrong db pwd).
    Since you have not mentioned the jdev version you use I'll assume that 11g.
    Click the database tab, find the node with the name of your project and open the node. Inside, you will see the db connections uses the module of the application. Right-click on each one and select Properties, check if all directions are written and test the connection. If you see "Test passed" for all connections the error message should disappear.

    Timo

  • void VI does not run with the main VI.

    My main and sub VI is attatched.

    danil33 wrote:

    Re: void / VI does not run with the main VI.

    When you start your main program, the Subvi is called and the main VI must wait the Subvi before it can continue. However, the Subvi is not set to open the Panel before, so very probably that it runs in the background for 100 seconds (1000 iteration to 100ms), because no one can press the stop button at the beginning to put an end to the Subvi. Once the Subvi is completed, the last value is returned to the main VI via the output connector and the main VI can process and display this last value. At this point, the main VI stops, because it's done (hopefully you do not "continuous operation").

    Obviously you have some misconceptions of beginners on the stream. Please we tell exactly what you expect the program to do, and we might be able to point in the right direction.

  • Windows Media player on my machine does not run some AVI files. How can I check what the problem with AVI files. Files are running in other utilities of free ware

    Windows Media player on my machine does not run some AVI files. How can I check what the problem with AVI files. Files are running in other utilities free ware. Also, windows Explorer does not display dimension and other video related information for the file. Y at - it a tool that can indicate what exactly is the problem with the file.

    Ritu

    Hello

    1. you get any error message?

    2. don't you make changes to the computer before the show?

    Please follow the steps from the link below.

    http://support.Microsoft.com/kb/279242

  • Program does not run in the emulator.

    Hello, I develop in Netbeans, version 7, I use J2ME and this the first time that I try to compile an application for BlackBerry, I download all the framework I need to develop an application for BlackBerry, I'm trying to run my program and the emulator of the BlackBerry beginning but my program does not run, I have no exception and any error, please if anyone can help me Thanks in advance.

    You can publish detailed information for we can help you as your code runs only not, what your average frame, etc...

  • Dictionary of Cambridge Advanced Learner does not run on windows 7 os.

    Dictionary of Cambridge Advanced Learner does not run on windows 7 os.

    What are the 'system requirements' for this software?

    Have you tried right clicking on the shortcut to the program or the .exe and select "Run As Administrator"?  Perform, even if your user name is an administrator.

    Try right-clicking on the real Setup.exe when you are installing the program and selecting the option "Run As Administrator"?  Perform, even if your user name is an administrator.

    Make older programs in this version of Windows (Windows 7)
    http://Windows.Microsoft.com/en-us/Windows7/make-older-programs-run-in-this-version-of-Windows

    Help with Windows 7 compatibility issues
    http://Windows.Microsoft.com/en-us/Windows7/help/compatibility

    Windows 7 Compatibility Center
    http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/default.aspx

  • a preparation free gata with GK Publications cd does not run on windows 7 Home Basic.

    A cd of free door preparation with GK Publications does not run on windows 7 Home Basic.

    I have buyed a book for the preparation of the door named GK Department with a cd inside, it includes the series of door documents test to practice. But it is to create an error message problem showing that Microsoft.jet.OLEDB.4.0' is not regestered on the local computer.    Please sort out the problem as soon as possible.

    Hi preyashi,

    Thanks for posting your question in the Microsoft community forum!

    I understand that you are having problems running a program from a CD on your computer. I'll help you solve the problem. To be able to understand the question in a better way, I would like to ask you a few questions.

    (1) did you make any changes before the show?

    (2) you are able to run the other Setup program on your computer?

    Senario 1:

    See if it is compatible with Windows 7.

    If this isn't the case, you could try installing in compatibility mode for Windows Vista or Windows XP.

    If the program is not compatible, then you try to install and run the program in compatibility mode.

    Use the following steps:

    (1) right click on the program.

    (2) click on Properties.

    (3) click on the tab compatibility.

    (4) select run this program in compatibility mode and select Windows Vista or other operating system, the program has been run successfully.

    Check out the link here: make sure to run older programs in this version of Windows

    http://Windows.Microsoft.com/en-us/Windows7/make-older-programs-run-in-this-version-of-Windows

    If compatibility is not successful, then try and run the program compatibility problems:

    1. open the troubleshooting program compatibility Troubleshooter by clicking the Start button.

    Then click on Control Panel. In the search box, type troubleshooting, and then click Troubleshooting. Under programs, click on run programs for previous versions of Windows.

    2. follow the instructions in the troubleshooting.

    If you are unable to install a program, insert the installation disc for the program and, using the Troubleshoot utility, navigate to the program setup file, usually called Setup.exe, Install.exe, or something similar. This utility is not designed to work on programs that have an .msi file name extension.

    Senario 2:

    The behavior you describe is expected if your application runs in 64-bit mode, all components that use must also be 64-bit. There is no 64-bit Jet OLE DB Provider, so that you get the message as described. You will receive a similar error when you try to connect to a database by using OLE DB or ODBC if there is no 64-bit of the specified OLE DB provider or ODBC driver version.

    This problem occurs only in applications that run in 64-bit mode. Compiling the application so that it works only in 32-bit mode is the current best solution.

    You may need to contact the manufacturer of the program to find out how to set the path target to x 86.

    More information

    32-bit and 64-bit Windows: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows7/32-bit-and-64-bit-Windows-frequently-asked-questions

    Please let me know the status of the issue. I will be happy to provide you with the additional options that you can use to get the problem resolved in Microsoft Windows.

  • I have a new HP Envy with Windows 8 desktop computer that still does not run properly. I rebooted, restored, ran chkdsk, sfc/scannow, uninstall/install update etc...

    I have a new HP Envy with Windows 8 desktop computer that still does not run properly. I have rebooted, restored (im doing this), ran chkdsk, sfc/scannow, malware, virus, uninstall/install etc and my machine wil always do not run for a long time without going through some sort of problem after an hour or two.  Can anyone suggest what to do about this? I read a lot of information online on all the windows 8 and fixes bugs, etc, but anything Microsoft/Windows, which ensures its customers, a hotfix or compesating their customers with software that still works. This isn't a hardware problem, and I can't keep day and bad shooting and trying to fix the day things in?

    Sincerely,
    A client who is a loss for words.
    Here are some problems in no particular order.
    1.) apps to not install it, and/or Windows saying they are when they are in fact not. The fix to install / uninstall, or get on the site of windows directly in general does not, and or does not at all.
    The change permissions 2.) does not work on files that you should be able to access in changing oxnership, permissions, etc.
    3.) Google chrome won't let me access my account of microsoft (or fact rarely) trying to access assistance. But internet Explorer doesn't?
    Randomly will increase from Internet 4.) a previous connection wired to wireless to a reboot.
    5.) my 8 'key' windows was only shown to me after that I have let Windows scan my machine online? Why? I paid for this... I restarted it and it says: service not available (it worked the third attempt which was 1-3 minutes after the initial analysis). Windows only showed my product ID not the key. I know that my victory. 8 was OEM when preinstalled I bought it new, but why didn't we files on it that had nothing to do with activation, appearing on dates for three weeks, or so before I bought it. What is the 'activation of the factory'?
    6 :) Windows Essentials does not hang for a long time, and the troubleshooterprogram of update simply does not work (I had to go to the website to try tp operate, the bluetooth functionality is not good that there is an error.
    7.) windows scan and repair gets stuck at 27% (Im not the only one with this problem).
    8.), avery MS Office 2013 Disappears so often and not easy to reload "we have encountered a problem.
     

    The computer manufacturer is responsible to see that it works properly with Windows 8. It says that it is a new computer I contact HP and make these problems their. If you don't get satisfactory results I turn and look elsewhere for a computer. Hope this helps and if you need another post to help and we will be happy to help you.

    The above opinion is mine and mine nothing and does not necessarily reflect that of Microsoft, it's employees, or any other Member of this forum.

    "When we try to take anything by itself, we find it hitched to everything else in the universe." -John Muir

  • I installed acrobat reader in window10 and demoted to the 8.1 window. After downgeading 8.1, acrobat reader does not run and also do not uninstall and reinstall. Only, I get the error message. What should I do?

    I installed acrobat reader in window10 and demoted to the 8.1 window. After downgeading 8.1, acrobat reader does not run and also do not uninstall and reinstall. Only, I get the error message. What should I do?

    Hi soyoungl9536964,

    Please try to run the cleanup tool "Download Adobe Reader and Acrobat tool - Adobe Labs" on your machine to remove all traces of the reader.

    Then, restart your machine and install the latest version of the player from here:

    Adobe Acrobat Reader DC install for all versions

    Let me know if any problem will persist.

    Kind regards

    Christian

  • I tried to install cs3 on windows 10 shadow run on my mac book pro.  Technical support told me that it does not run on windows 10 but doesn't give me an opinion on whether she would go if I was running windows 7 to the people's Summit.

    I tried to install cs3 on windows 10 shadow run on my mac book pro.  Technical support told me that it does not run on windows 10 but doesn't give me an opinion on whether she would go if I was running windows 7 to the people's Summit.  Any thoughts?

    First of all, that the software is old enough so that it does not at all with Windows 10... but

    An idea that MAY work to install or run some programs in Windows old 10

    -http://www.tenforums.com/tutorials/15523-compatibility-mode-settings-apps-change-windows-1 0 - a.html

    First, that the software is old enough for that it may ALSO not work with Windows 7... but

    For Windows 7 you right click on the program and select a compatibility option in the pop-up window

Maybe you are looking for