javascript - Gives me this error in gplus-api using JS -


Hello, I started using Javascript to learn JeepPlus-API sign, but I got an error which says this '<'> 'PostMessage' on 'DOMWindow' failed to execute: Target origin provided ('file: //') does not match the origin of recipient window ('null'). This is my code, but I have mentioned this on this site; help me!

My code

  & lt ;! DOCTYPE HTML & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Script src = "https://apis.google.com/js/client:platform.js" async defer & gt; & Lt; / Script & gt; & Lt; Meta name = "google-signin-clientid" content = "MY_CLIENT_ID.apps.googleusercontent.com" & gt; & Lt; Meta name = "google-signin-scope" content = "https://www.googleapis.com/auth/plus.login" /> & Lt; Meta name = "google-signin-requestvisibleactions" content = "http://schema.org/AddAction" /> & lt; Meta name = "google-signin-cookiepolicy" content = "single_host_origin" /> & Lt; Script type = "text / javascript" & gt; (Function () {var po = document.createElement ('script'); po.type = "text / javascript"; po.async = true; po.src = "https://apis.google.com/js/ Client: Ploson.JS "; var s = document.getElementByTagName ('script'); s.parentNode.insertBefore (po, s);}); Function render () {// Additional parameters, including callback, will come from the rest of the parameter // page-level configuration. Var additionalParams = {'callback': signinCallback}; // Attach a click listener on one button to trigger the flow. Var signinButton = document.getElementById ('signin button'); SigninButton.addEventListener ('click', function () will use {gapi.auth.signIn (extra param); // page level configuration}); } SigninCallback (authResult) {if (authResult ['status'] ['signed_in']) {// Update app to reflect a signed user // Now hide sign-in button that the user is authorized, for example For: Document.getElementById ('signin button') setAttribute ('style', 'display: none'); } Else {// Update the app to display a signed user // Probable error value: // "user_signed_out" - The user has been signed out // "access_denied" - The user has your app / "instant _file "Does not allow login from the user console.log is not automatically logged in ('sign-in state:' + authResult ['error']); }} & Lt; / Script & gt; & Lt; Button ID = "Signin Button" & gt; Google & lt; / Button & gt; Sign in with & lt; / Body & gt; & Lt; / Html & gt;  

My JS is the original one, whenever I try to load this URL it gives me a 404 error Please give me this error Help solve!

While working with Google+ sign, Locally). A simple example is to set the Python to 8080 with its port:

  Python -M Simple HTTPServer 8080  

You can use Apache or other for local testing You can also configure / run the server.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -