Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"This page contains both secure and nonsecure items"

Status
Not open for further replies.

traimo

Programmer
May 7, 2003
13
0
0
US
Hello,

OK, here is my problem. I have written a custom IE toolbar that calls some javascript functions and these functions are in a .js file. First I tried this:

var newscript = document.createElement("script");
newscript.type = "text/javascript";
newscript.src = "c:\\iebar.js";
document.body.appendChild(newscript);
Test();

However, this triggers a popup warning from IE saying, "This page contains both secure and nonsecure items". After doing some research, I realized that I was getting this warning only on HTTPS pages. So, then I tried this:

var newscript = document.createElement("script");
newscript.type = "text/javascript";
newscript.src = "document.body.appendChild(newscript);
Test();

The first time I click on a toolbar button I get an error saying, "Object Expected". However, if I click the same IE toolbar button again it works. It only errors out the first time. It is like the first time the .js file is not loaded. Does anyone have any suggestion?

Thank you,
 
Try putting the call to "Test" in a setTimeout with a delay of, say, 5 seconds. If it works, reduce the delay. It may well be a timing issue, as pages loaded over https will always be slower to load than the same page locally from your PC.

Hope this helps,
Dan




[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Dan, thanks for the tip. That did work. However, it is kind of slow. I'd really like to figure out why the first solution is giving my the popup warning. Anyone got a clue?

Tony
 
traimo said:
it is kind of slow

self said:
If it works, reduce the delay.

traimo said:
I'd really like to figure out why the first solution is giving my the popup warning. Anyone got a clue?

self said:
It may well be a timing issue, as pages loaded over https will always be slower to load than the same page locally from your PC.

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top