PDA

View Full Version : DHTML Window Widget on https



templar
05-07-2007, 12:10 PM
1) Script Title: DHTML Window Widget

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

3) Describe problem:
When script is used on a secure connection (https) IE complains that "This page contains both secure and non-secure items". This happens both on the included demo and on my own pages, and I can't figure out how to solve it. I don't see what the non-secure items are. Anyone got a clue?
I really need help to figure this one out..

templar
05-07-2007, 12:36 PM
Ok,that didn't take too long to figure out. When loading a IFrame without setting the src parameter IE interprets this to point to a unsecure protocol and therefor warns.
The solution in this case is to change the code in dhtmlwindow.js line 125 and set a default page that's available over https instead of src="", i.e. src="/blank".

Hope this helps if anyone else comes across this problem.

To the developers:
Is there a reason why the IFrame location isn't set immediately? I tried the following code and it seems to work fine, fixing the issue mentioned above..
dhtmlwindow.js line 124
if (!t.contentarea.firstChild || t.contentarea.firstChild.tagName!="IFRAME") //If iframe tag doesn't exist already, create it first
t.contentarea.innerHTML='<iframe src="' +contentsource +'" style="margin:0; padding:0; width:100&#37;; height: 100%" name="_iframe-'+t.id+'"></iframe>'
else
window.frames["_iframe-"+t.id].location.replace(contentsource) //set location of iframe window to specified URL

ddadmin
05-07-2007, 06:26 PM
Regarding your last question, just for reference, the original code is:


if (!t.contentarea.firstChild || t.contentarea.firstChild.tagName!="IFRAME") //If iframe tag doesn't exist already, create it first
t.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100&#37;; height: 100%" name="_iframe-'+t.id+'"></iframe>'
window.frames["_iframe-"+t.id].location.replace(contentsource) //set location of iframe window to specified URL

The reason for the delay in setting the IFRAME src using window.frames[] instead has to do with a bug in Firefox (or perhaps it was IE 5.5, I forget) that caused the iframe to not be set to the specified URL otherwise. Again, I forget if it was Firefox or some version of IE. You may want to do a thorough testing of your modified code to make sure it works correctly in all the intended browsers.