<Forge Viewer> Nothing is displayed by a browser. - autodesk-forge

A model was displayed normally until last week.
But Nothing is displayed by a Browser Today.
The following log is displayed to a Chrome-console.
GET viewer3D.min.js:4
https://developer.api.autodesk.com/derivativeservice/v2/manifest/<MyUrn>
401 (Unauthorized)
Was there the change of specifications about any OAuth or Derivative API?
Is there the method avoiding this error?
I used this as reference.

We have solved the problem by ourselves.
It was the bug of viewer3D.min.js(Ver2.11).
I changed Javascript URL.
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js"></script>
↓
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js?v=2.10.*"></script>
Thank you for All.

Related

// does not match http or https

I have seen in a number of place where they used "//maxcdn.bootstrapcdn.com/...", they never worked for me. I had to use http with them.
Now I have enabled https on my site and from various questions, the answer appears that if you use "//" it will match either http or https (which ever is in the url) but that does not work for me. It does not match. It always pull https version. As an example, this is in my code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
If you got to view-source:https://www.peshawar.co/peshawar/, you will http version being pulled. The same is true for all other links.
So my question is what am I doing wrong? Some relevent questions
Problems loading style sheets over https
Is it valid to replace http:// with // in a <script src="http://...">?
Also ideally I need a solution that works locally as well as on domain.
OK My bad. I was editing the wrong file. // does work :)

SitesApp.getActivePage() always return landing page

I use the following function:
function doGet(e) {
Logger.log( SitesApp.getActivePage().getName())
}
It always returns the name of the home page
This seems to be an issue with Google currently. All Google Sites are facing this issue. Please submit a bug report, and cross your fingers it'll be solved soon.
Here is an existent bug report of this issue. Please +1 it to give it more attention.
There is an older discussion about this issue here Apps Script .getActivePage() only returning "home" page
which suggests the problem can be related to using setHtmlContent() when the embedded html gets modified. There has been a recent problem with htmlbox on Google Sites for which a fix is in the process of rolling out which may have some bearing on this issue
Hi I have the same issue. My script worked on Old Google Site, but it doesn't work anymore on a new Google Site.
And the issue in this code:
var pageUrl = SitesApp.getActivePage().getUrl();
My question is almost the same: How to get URL of the current page on the New Google Site with GAS?
google.script.url.getLocation
google.script.url.getLocation(function(location) {
console.log("locations:----------------------------------------");
console.log(location);
console.log(location.parameters);
console.log(location.hash);
console.log("----------------------------------------");
});
The code above gives the next output:

Does Postmessage work between individual web pages under the same domain? If so, how?

In my code, I have this:
<script>
var iframe = document.getElementById("some_iframe").contentWindow; //sending part
iframe.postMessage("X", 'http?://example.com');
</script>
On the receiving page, I have
<script>
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) { alert(e.data); } // no security concerns here, just the message is needed
</script>
When I look into the console of the sending page, I get this error:
Unable to post message to http?://example.com. Recipient has origin http?://www.example.com
Can't post more than two links, whatever so I put a ? just after http. Not actually in the code.
Actually, I think I found the answer. It's subtle, but www is what's interfering, right? But just to be sure, you can use postMessage for communication between two documents on the same server?
Some example code would be great as well. Thanks!
You can look in detail about how postMessage works and the quirks when dealing with same-or-cross-domain and sandboxing in this tutorial. For basic reference see this article.
In short, you can do postMessage between any two windows, no matter the domain.
Now that I think of it, just to be clear, both windows have to be open under the same document tree, meaning they must have a common parent document (as in the same browser tab on the same device). I am not sure if you think you can achieve this on different browsers or tabs or devices, which is not the case, and you must look at web-sockets and webRTC for that, as this is a completely different feature.

facebook like button won't "like"

So what's strange is that the like buttons on my site will only work IF the like button has already been liked in the past. If there are no current likes, such as on this page:
http://www.narutomeetsbleach.com/naruto-shippuden-219.html
Then you can click like all you want, but you won't actually like anything. Does anyone know what's wrong? I got my like HTML directly from facebook and it's the exact same as the like buttons that are working.
Thanks so much!
You can use the Facebook LINT tool. It actually checks you meta tags and will point you in some direction what your problem is. (Check link below.. I have added a ?v=1 to the html page to avoid facebook server error response)
http://developers.facebook.com/tools/lint/?url=http%3A%2F%2Fwww.narutomeetsbleach.com%2Fnaruto-shippuden-219.html%3Fv%3D1
Type in your url and check your page.
Try changing your code to the following (is there a reason why you are using the appId/fbAsyncInit methods?):
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://www.narutomeetsbleach.com/naruto-shippuden-219.html?v=2" send="false" layout="button_count" width="450" show_faces="false" font="tahoma"></fb:like>
AND / OR
Use this link to generate your LIKE BUTTON Code
http://developers.facebook.com/docs/reference/plugins/like/
Generated Like Button Code (Iframe) :
<iframe src="http://www.facebook.com/plugins/like.php?app_id=137084976372144&href=http%3A%2F%2Fwww.narutomeetsbleach.com%2Fnaruto-shippuden-219.html%3Fv%3D3&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
Found it out! I had to remove the og:type meta tag. Found someone else on google who had a similar problem, that's what he did and now it seems to be working fine for me after I re-linted the url. Facebook's giving me a "warning" because I have og:type missing, but now it's working, so I guess that's all that matters. Thanks for all the help!
reference: Facebook "Like" produces "There was an internal error when updating the Page."
The Facebook button and all it's code comes from them and it's within an iframe with source from their server... you'll have little control over how that works. As long as you got your App ID and such entered correctly... otherwise, you're at their mercy.
Yes, even though it's just a "Like" button, you still need an App ID (appid). More detailed info below...
See the accepted answer to this: "Do I need an appid for the XFBML version of the Facebook Like button?"
And quoting this page, http://developers.facebook.com/docs/guides/web/:
"The JavaScript SDK requires that you register your website with Facebook to get an App ID (or appId). The appId is a unique identifier for your site that ensures that we have the right level of security in place between the user and your website. The following example shows how to load the JavaScript SDK once you have your appId:"

Google Maps API key not working

I'm having a problem with getting my Google Maps API key to work. I originally had the problem when trying to access http://dev.domain.com using a key generated for http://domain.com, however I subsequently tried generating a key for http://dev.domain.com and it still didn't work.
I get the typical This web site needs a different Google Maps API key. A new key can be generated at http://code.google.com/apis/maps/. alert message when trying the site. Checking their FAQ and following it's instructions to alert(window.location.host) to check the domain returns dev.domain.com which looks correct (unless it's meant to have http:// at the start? In which case I don't see how I've done something wrong).
Both keys (dev.domain.com and domain.com) work correctly on localhost.
Does anyone have any ideas on what I can do to solve this or any further tests I can do to work it out?
I came across this question as I was just now beating my head against this same issue. I finally noticed that the code Google provided for linking to the API was different from what I'd been using. I replaced this
<script type="text/javascript" src="http://www.google.com/jsapi?key=___">
</script>
<script type="text/javascript">
google.load("maps", "2.x", { "language": "en" });
</script>
with this
<script type="text/javascript"
src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=___">
</script>
and the error went away.
I was having the same problem and it turned that i was doing 2 calls to the http://www.google.com/jsapi url. The first one for adsense (without the key parameter) and then the second one for google maps with the key. Pretty stupid mistake but the result is that the although you put the key on the second call it doesn't use it.
I was getting the same problem and when i look at src part i found that my querystring part of src is wrong.
<script src="http://maps.google.com/maps?file=api&v=2&&hl=en;key=MY_API_KEY&sensor=true"
type="text/javascript"></script>
I clearly typed wrong querystring part. &\amp;&hl=en;
I put & to wrong place. Then i changed my wrong syntax with a correct one
<script src="http://maps.google.com/maps?file=api&v=2&hl=en&key=MY_API_KEY&sensor=true"
type="text/javascript"></script>
And voila it worked.
Google Maps APi not working in Firefox and IE but working in Chrome and Safari
CSS-Bug
Hi everyone, this is slightly off-topic, but since it cost me a whole day to figure this out i want to share it.
I had the above mentioned problem. The maps would load but except for the google log and terms of use, the map was just grey.
SOLUTION
somewhere in a parent css i had following cod:
#content * {
max-width: 100%;
}
removing it solved the problem;
hope this helps
After going through their FAQ i found that if we want our subdomains to enable Google map we have to request the API for http://domain.com/ (without www) . it worked for me.
Happy coding.
I've been fighting key issues for the last couple of hours. Was working on localhost, but not on my local network address or a domain name. I solved the issue by changing v=2 to v=2.x. I haven't tried 2.s. Also adding alert(window.location.host) for both my localhost address and domain name to a Browser Key in google's api console for maps v2.
As said in my comment I ended up using the v3 API as this never ended up being solvable.
I had the same problem when I added line breaks to the src element for readability:
<script src="http://maps.google.com/maps?file=api&
v=2&
key=ABQ...BlaBlaBla...cVw"
type="text/javascript" />
Removing the line breaks from the src element solved the problem:
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQ...BlaBlaBla...cVw"
type="text/javascript" />