Mixed Content using Google Maps - google-maps

I use gmaps show Map in my web site.
MY CODE
<div class="col-md-12" >
<script type="text/javascript" content="zk.googleAPIkey='***MyKey***'" />
<gmaps id="gmaps" zoom="${initialZoom}" lat="${initialLatitude}" lng="${initialLongitude}" width="100%" height="350px" showSmallCtrl="false" >
<gmarker id="marker" content="" visible="${false}" />
</gmaps>
</div>
In my local server work fine but in my productive server with https don't work and i have this error:
EXCEPTION
zk.wpd:20 Mixed Content: The page at 'https://www.domain.com/' was loaded over HTTPS, but requested an insecure script 'http://www.google.com/jsapi?key=***MyKey***'. This request has been blocked; the content must be served over HTTPS.loadScript # zk.wpd:20

added the following and solved my problem
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"/>
in head

I solvel my problem remplace zk.googleAPIkey=****key*** for https://maps.googleapis.com/maps/api/js?key=****key***
The problem is this tag zk.googleAPIkey because your value is http://maps.googleapis.com/maps/api/js? the problem is the http
Before
<script type="text/javascript" content="zk.googleAPIkey='***MyKey***'" />
After
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=***key***" />

From ZK demo of google maps :
<gmaps version="3.26" id="gmaps" width="520px" height="400px" showSmallCtrl="true" protocol="https">
Can you try adding the protocol property?

Related

HPP Customizatoin

I'm experiencing with rxp-hpp.js and would like to customize the HPP form displayed in my iframe.
I have followed instructions at https://developer.globalpay.com/ecommerce/hosted-solution/customization but I'm unable to get HPP to use my CSS.
Any help would be appreciated.
My html page
<html>
<head>
<title>HPP P2 (hpp:body)</title>
<meta charset="UTF-8">
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
<script src="/lib/rxp-hpp.js"></script>
<link rel="stylesheet" type="text/css" href="./css/styles.css">
<script>
// get the HPP JSON from the server-side SDK
$(document).ready(function () {
$.getJSON("/examples/hpp/proxy-request.php?slug=process-a-payment", function (jsonFromServerSdk) {
RealexHpp.setHppUrl('https://pay.sandbox.realexpayments.com/pay');
RealexHpp.embedded.init("payButtonId","targetIframe","/examples/hpp/response.php", jsonFromServerSdk);
});
});
</script>
</head>
<body>
<hpp:body />
<input type="submit" id="payButtonId" value="Checkout Now 3.6.1" />
<br />
<iframe id="targetIframe" height="700" width="400" style="display:none;"></iframe>
</body>
</html>
As mentioned in the documentation, all images or CSS used in the template must be referred to locally on our server; no absolute URLs to external images or CSS. You'll need to include the image files along with the template page.
You will need to create this template (JavaScript is not needed) and then send it to the support team, which will upload it to the HPP server, under the merchant provided by you - once the process is completed, you will be able to see the styling being loaded inside the HPP. The support team can be contacted at ecomsupport#globalpay.com

how to retrieve URL into GSP

i am trying to show a content in iframe..it works at localhost
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><g:message code="default.list.label" args="[entityName]"/></title>
</head>
<body>
<div class="body">
<iframe style="width: 100%;min-height: 400px;height: 600px" src="https://www.google.com" />
</div>
</body>
</html>
but when i build a war and deploy it to server...that page was blank?
why?
Because Facebook doesn't allow it:
curl -v https://www.facebook.com
...
< X-Frame-Options: DENY
...
With DENY value:
The page cannot be displayed in a frame, regardless of the site
attempting to do so.
Google and many other sites have similar configuration, so please check for header. Also, you could open Chrome Developer Console, and check for errors
See docs for this header: https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header

dojo mobile with phonegap doesn't work properly

I start write application using phonegap and dojo in Eclipse. Phonegap, without dojo work properly on android emulator and in chrome with ripple addon. Problem is when I added dojo to project. I use phonegap 2.7.0 and dojo 1.9.0.
I was using: http://www.ibm.com/developerworks/web/library/wa-mobappdev1/ tutorial to setup this.
How I setup dojo:
index.html file:
<!DOCTYPE HTML>
<html>
<head>
<title>PhoneGap</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="libs/dojo/dojox/mobile/themes/android/android.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
<script type="text/javascript" src="libs/dojo/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
<script type="text/javascript" charset="utf-8" src="cordova-2.7.0.js"></script>
<script type="text/javascript" charset="UTF-8" src="funkcja.js"></script>
<script type="text/javascript">
dojo.require("dojox.mobile.parser");
dojo.require("dojox.mobile");
dojo.require("dojox.mobile.app");
dojo.require("dojox.mobile.Button");
</script>
</head>
<body>
<div dojoType="dojox.mobile.View" id="site" selected="true">
<h1 dojoType="dojox.mobile.Heading">Index</h1>
<div>
<input dojoType="dojox.mobile.Button" type="button" id="submit" name="submit" value="Button" onclick="loguj()"/>
</div>
</div>
</body>
</html>
In emulator I get a blank screen.
In chrome using ripple I get just html without dojo scripts. Scripts are include. In console I get an errors:
Console was cleared ripple.js:37
Ripple :: Environment Warming Up (Tea. Earl Gray. Hot.) ripple.js:37
Uncaught SyntaxError: Unexpected token u Insertion.js:1
GET http://localhost/config.xml 404 (Not Found) ripple.js:50
cordova :: Initialization Finished (Make it so.) ripple.js:37
GET http://localhost/libs/dojo/dojo/fx/Toggler.js 404 (Not Found) ripple.js:50
Error {src: "dojoLoader", info: "xhrFailed"} dojo.js:15
GET http://localhost/cordova_plugins.json 404 (Not Found) ripple.js:50
Uncaught SyntaxError: Unexpected token < cordova-2.7.0.js:6816
GET http://localhost/libs/dojo/dojo/resources/blank.gif 404 (Not Found) app.js:15
deviceready has not fired after 5 seconds. cordova-2.7.0.js:6672
Channel not fired: onPluginsReady cordova-2.7.0.js:6665
Channel not fired: onCordovaReady cordova-2.7.0.js:6665
Channel not fired: onCordovaConnectionReady cordova-2.7.0.js:6665
deviceready has not fired after 5 seconds. cordova-2.7.0.js:6672
Channel not fired: onPluginsReady cordova-2.7.0.js:6665
Channel not fired: onCordovaReady cordova-2.7.0.js:6665
Channel not fired: onCordovaConnectionReady cordova-2.7.0.js:6665
Dojo tries to load his js files, but can't. I think this answer may work for you too:
PhoneGap / Cordova 1.6 and dojo 1.7.2 AMD works from web, not from local?
Set the djConfig of dojo.js to djConfig="async:false,parseOnLoad:true"
AND load cordova.js before dojo.js !
If it doesnt work & you want to start developing, try to use dojo.js from the web.
Just create a cordova_plugins.json file into www with {} inside.
Alternatively, you can comment out lines 6395->6415 from cordova-2.7.0.js.
I followed the same tutorial on IBM Website and it also did not work.
To make it work I had to do the following:
Remove djConfig="parseOnLoad:true"
Replace
dojo.require("dojox.mobile.parser");
dojo.require("dojox.mobile");
dojo.require("dojox.mobile.app");
dojo.require("dojox.mobile.Button");
with:
require(["dojox/mobile/parser", "dojox/mobile", "dojox/mobile/app", "dojox/mobile/Button", "dojo/domReady!"],
function(parser) {
parser.parse();
}
);

iframe returns homepage instead of external file

I'm trying to embed a html5 banner created in Adobe Edge, the simplest way I could think of was dumping all the code edge spits out onto the ftp and then using an iframe to point at the html file. If I do this locally on my machine it works fine, if I try it on our live site the top left corner of the website is what appears in the iframe instead of the banner. It's a Joomla 1.5 site I have no idea what would cause this as I've not used iframes before. I've edited the code so it no longer has spaces.
Here is my website: www.webchild.com.au
and here is the iframe code:
<iframe src="/stdAds/html5/bilby-test/bilby_theatrical_banner.html" width="300" height="250" frameborder="0" scrolling="no"></iframe>
The code inside the html file is:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>Bilby Theatrical Productions Banner</title>
<!--Adobe Edge Runtime-->
<script type="text/javascript" charset="utf-8" src="bilby_theatrical_banner_edgePreload.js"></script>
<style>
.edgeLoad-EDGE-380725615 { visibility:hidden; }
</style>
<!--Adobe Edge Runtime End-->
</head>
<body style="margin:0;padding:0;">
<div id="Stage" class="EDGE-380725615">
</div>
</body>
</html>
Try removing the spaces out of your link. It may well be the %20's replicating the spacebar are screwing up the link. Else have you checked the html file your including is definately in the correct location on your FTP. If you just try going straight to the link ( http://www.webchild.com.au/stdAds/html5/bilby-test/Bilby%20Theatrical%20Banner.html ) you can see there is a 404 error which is probably why the top of your site is appearing - the 404 error page rather than the page

Loading content using AJAX and jQuery

I am a newbie to jQuery and was trying to load content dynamically using AJAX and jQuery using the following code but its not working.
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("button").click(function()
{
$(".text").load("http://api.jquery.com/get/");
});
});
</script>
<title>AJAX with jQuery</title>
</head>
<body>
<div class="text">Sushil</div>
<button>Load Text</button>
</body>
</html>
You are violating the same origin policy. Just open your console and see the error message when you click the button. Things will become clearer to you. If not please get back
I ran your code and I got this error:
XMLHttpRequest cannot load http://api.jquery.com/get/. Origin null is not allowed by Access-Control-Allow-Origin.
I googled it and I got this: Origin null is not allowed by Access-Control-Allow-Origin