Results 1 to 3 of 3

Thread: DHTML Window Widget on https

  1. #1
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML Window Widget on https

    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..

  2. #2
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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
    Last edited by templar; 05-07-2007 at 12:46 PM.

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Regarding your last question, just for reference, the original code is:

    Code:
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •