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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript widget works only on temp domain, not on main domain. directory path issue? 1

Status
Not open for further replies.

Dirkster

Technical User
Jan 2, 2019
2
LC
Roadblock. Any help greatly appreciated! Javascript widget not executing. Returns white page. It's a standard autogenerated script.

I generated the javascript widget from wind guru that works like a charm on temporary bluehost domain:


However, exact same file called from main domain name presents white page only:


Contacted hoster "Bluehost", no help. They refer to directory path issue. No success with google. Tried to manually add directory root, no luck:

<script src=" type="text/javascript"> directory_root = " </script>

Here is the complete script:

<script src=" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
//<![CDATA[
WgWidget({
s: 77995, odh:0, doh:24, wj:'knots', tj:'c', waj:'m', fhours:72, lng:'en',
params: ['WINDSPD'],
first_row:true,
spotname:true,
first_row_minfo:true,
last_row:true,
lat_lon:true,
tz:true,
sun:true,
link_archive:false,
link_new_window:false
},
'wg_target_div_77995_42085527'
);
//]]>
</script>
<div id="wg_target_div_77995_42085527"></div>
 
Hi

You access your "main domain" using HTTPS but including the script using HTTP protocol. These day's browsers block that because security concerns :
FireFox Console said:
Blocked loading mixed active content “

For that reason the common practice is to not specify the protocol, that way the browser will use the same protocol as for the parent document :
Code:
[b]<script[/b] [maroon]src[/maroon][teal]=[/teal][i][green]"//widget.windguru.cz/js/wg_widget.php"[/green][/i] [maroon]type[/maroon][teal]=[/teal][i][green]"text/javascript"[/green][/i][b]></script>[/b]


Feherke.
feherke.github.io
 
WOW!!!

SPOT ON!!!

Solved! Thank you soooooooo much !!!!!!!!!!!!!!!!!!!

Feherke, you rock!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top