WordPress.org

Ready to get started?Download WordPress

Forums

Advanced iFrame
[resolved] ai_external.js not found (5 posts)

  1. Jason Judge
    Member
    Posted 9 months ago #

    I am trying to set an iframe to automaticllly resize to fit the content. The settings page tells me to load this JavaScript from the iframe site:

    http://mysite.com/wp-content/plugins/advanced-iframe/js/ai_external.js

    The problem is, that page gives me a 404. I don't have FTP access to the WP site, so I cannot see if the file really is there. Any ideas?

    The domain is correct and the URL is copied straight from the settings page. But still a 404 and no JavaScript.

    http://wordpress.org/plugins/advanced-iframe/

  2. Jason Judge
    Member
    Posted 9 months ago #

    I've downloaded the plugin and looked at the code. There is only a ai_external.template.js there. Am I understanding this correctly that this file needs to be copied to ai_external.js and modified?

    Knowing the way WP will delete all the files in a plugin when it gets updated, isn't that actually a bad place to put a customised file? Can it go anyway, in the theme perhaps?

    The code to change looks like this:

    var domain = 'WORDPRESS_SITE_URL';

    So is it a URL or a domain that needs to go in there? Do I use example.com (the domain) or http://example.com (a URL) or can I use //example.com and not have to worry about whether I'm on http or https?

  3. Jason Judge
    Member
    Posted 9 months ago #

    If this script is called from the WP site, and needs to be customised to include the domain of the WP site, then am I missing something? Doesn't the script already know the domain it is loaded from? If so, why does it need the domain to be hard-coded in the file?

  4. Jason Judge
    Member
    Posted 9 months ago #

    Okay, what wasn't clear to me, is that just going to the settings page and saving will create the ai_external.js page automatically from the template, with the required settings in there.

    I think there is a lot of detail in the instructions that can confuse things. To have your iframe, containing content from another domain, automatically resize to the content it shows, there are two steps:

    1. Go to the settings page for this plugin. Save the settings.
    2. Add the specified JavaScript link to the bottom of your page delivering the iframe content.

    With all things being equal, that's it, just those two steps.

    There are some conditions that need to be considered, but only if the above doesn't work. Making sure http/https is consistent across the WP site and the iframe site, is one condition. What happens if the settings page does not have write permission to the JS folder (and it really shouldn't for good security reasons, but did on my client's site)? No idea. But honestly, worry about all that once you have followed step 1 and step 2 and find it still doesn't work.

  5. Jason Judge
    Member
    Posted 9 months ago #

    One problem I now have, is that all the JS in the embedded form is now broken - it is not working at all. Firebug shows no errors, so I don't know what is going on there.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.