• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem with cpAPIInterface

New Here ,
Oct 26, 2018 Oct 26, 2018

Copy link to clipboard

Copied

Hi. I am trying to recreate the passing of variables from an iframe as discussed in this thread on this forum. I have copied the code exactly and deployed it on a server with JSON enabled. It doesn't work when it appeared to work for both of them. I get the error that cpAPIInterface is undefined.

Here is the console from Firefox:

console.png

Does anyone know what the problem is? Thanks.

Views

266

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2018 Oct 26, 2018

Copy link to clipboard

Copied

I am using Captivate 2017.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 28, 2018 Oct 28, 2018

Copy link to clipboard

Copied

That doesn't seem like a normal webpage loaded into Captivate. There is Google ad and adclick things there. You are getting an error that you cannot communicate with cross domain scripting. What is the page that is embedded in the iframe, it needs to be on the same domain.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2018 Oct 30, 2018

Copy link to clipboard

Copied

Thanks. Yes, unfortunately, those other things are coming from the server. Trying it on another server produced the same results. I have tried to have the source of the iframe be both a fully justified URL and a relative URL in exactly the same folder on the server as the published Captivate file because I was worried about cross scripting issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 30, 2018 Oct 30, 2018

Copy link to clipboard

Copied

just try using window.parent.window.your_variable_name;

If it's HTML5 you don't really need the interface object.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2018 Oct 30, 2018

Copy link to clipboard

Copied

Thanks. That's now getting the last statement to be logged in the console. However, the value is still not being passed to Captivate.

I realize that my initial screenshot did not include the first warning:

unreachable code after return statement [Learn More] CPXHRLoader.js:13471:12

I'm still getting that warning when I click the Submit button.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2018 Oct 30, 2018

Copy link to clipboard

Copied

I'm sorry. I'm getting that warning on page load, not when clicking the button.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 30, 2018 Oct 30, 2018

Copy link to clipboard

Copied

That's a different issue altogether. I used to get that frequently, but not for some time now.

Don't know how to fix it anymore, there is usually an error with missing parens in a function.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2018 Oct 30, 2018

Copy link to clipboard

Copied

LATEST

OK. Good. Thanks for helping me troubleshoot.

I'm still getting the warning:

HTTP load failed with status 404. Load of media resource https://servername.ca/users/decourcp/ASTest2/_cp_n_m_ failed.

I thought that might have been related to the Loader.js warning.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources