Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6964529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:56:11+00:00 2026-05-27T15:56:11+00:00

I’m using Fancybox from FancyApps to preview content on my website. <a href=#inline class=various><span

  • 0

I’m using Fancybox from FancyApps to preview content on my website.

<a href="#inline" class="various"><span class="info"></span></a>

<div id="inline" style="display:none;width:500px;">
    <h2>Always enjoy the sunny days!</h2>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        $(".various").fancybox({
                maxWidth    : 500,
                autoSize    : true,
                closeClick  : false,
                openEffect  : \'none\',
                closeEffect : \'none\'
            });
    });
</script>

Basically this is working fine, but in one situation I need to redirect my site to a secure server, so the domain will change.

Example:

https://secure-payment.com/relay/v2/relay.cgi/http://www.mydomain.com/checkout

When I use the link to trigger Fancybox no this page, I just get “The requested content cannot be loaded. Please try again later.“

In addition (I don’t know if it’s relevant) I’m running the script below on the bottom of my page, this is as requested from the payment company.

//
// Variables used for searching
//
var relayurl = "https://relay.ditonlinebetalingssystem.dk/";
var relayurl_replace = "https://relay.ditonlinebetalingssystem.dk/relay/v2/relay.cgi/";
var baseurl = "";

function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
} 

//
// Replace all links to NOT use the relay-script when the user clicks on the links
//
function replaceRelayButtons(parent, startTimer) {  
    var aEls = parent.childNodes;
    for (var i = 0, aEl; aEl = aEls[i]; i++) {
        //
        // Do recursive call
        //
        replaceRelayButtons(aEls[i]);

        if (aEls[i].tagName == 'A' || aEls[i].tagName == 'a') {
            if (aEls[i].href.indexOf(relayurl) == 0) {
                aEls[i].href = aEls[i].href.replace(relayurl_replace, "");
                aEls[i].href = aEls[i].href.replace(relayurl, "")
                if (aEls[i].href.indexOf("http://") != 0) {
                    aEls[i].href = (baseurl + "/" + aEls[i].href);
                }
            }
        }
        if (baseurl.length > 0) {
            if (aEls[i].tagName == 'IMG' || aEls[i].tagName == 'img') {
                if (aEls[i].src.indexOf(relayurl) == 0 && aEls[i].src.indexOf(relayurl_replace) == -1) {
                    aEls[i].src = aEls[i].src.replace(relayurl, relayurl_replace + "/" + baseurl + "/");
                }
            }
        }
    }

    //
    // Now start the timer which runs this function again to fix all body elements that might not be loaded in the browser yet
    //
    if (startTimer) {
        setTimeout("replaceRelayButtons(document.body, false)",1000)
        setTimeout("replaceRelayForms()",1000)
    }
}

//
// Replace all form actions to NOT use the relay-script when the user clicks on the links
//                              
function replaceRelayForms() {
    for (i = 0; i < document.forms.length; i++) {
        if (document.forms[i].action.indexOf(relayurl) == 0) {
            document.forms[i].action = document.forms[i].action.replace(relayurl_replace, "");
            document.forms[i].action = document.forms[i].action.replace(relayurl, "")
            if (document.forms[i].action.indexOf("http://") != 0) {
                document.forms[i].action = (baseurl + "/" + document.forms[i].action);
            }
        }
    }
}

//
// Go and replace the urls and form actions
//
if (getURLParam('baseurl') != null) {
    baseurl = getURLParam('baseurl')
}
replaceRelayButtons(document.body, true);

What Might I be doing wrong? Is this even possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:56:12+00:00Added an answer on May 27, 2026 at 3:56 pm

    I don’t think much is wrong, but you can’t load a HTTPS URL into a HTTP url, because it should be a secure URL aswell. This because fancybox generates a iFrame if the URL is another domain.

    IE will show you a error, but Firefox will load the page, try it and you will see.

    For more detailed information: JavaScript HTTPS to HTTP iFrame Security Question

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.