Javascript + IFrame + Chrome + Https = strange issue

Posted by GuiDoody on Stack Overflow See other posts from Stack Overflow or by GuiDoody
Published on 2011-01-08T19:50:34Z Indexed on 2011/01/08 19:53 UTC
Read the original article Hit count: 158

Filed under:
|
|

Using a modal plugin for jquery, I'm opening an iframe in a modal with a click event and setting the source attribute to a relative url (should be within https). The page containing the click is an authenticated ssl page.

In IE and Safari, this works as expected. In Chrome and Firefox, the source url is opened in http not https. If I set the source to an absolute url using https, same result.

Example:


// This doesn't work - resolves to http
$('.lnkViewDetails').click(function(e){
    var src = "/ThePage";
    $.modal('<iframe src="' + src + '" height="500" width="425" style="border:0" frameborder="no">');
});

// This doesn't work - also resolves to http
$('.lnkViewDetails').click(function(e){
    var src = "https://MySite.com/ThePage";
    $.modal('<iframe src="' + src + '" height="500" width="425" style="border:0" frameborder="no">');
});

Anyone know a way to get around this?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery