+ Start a Discussion
XactiumBenXactiumBen 

Javascript behaviour different in sandbox to developer and production orgs

I have a managed package with a page in it that calls some javascript.  Put simply, the javascript gets a div element from the page and uses its offsetWidth and offsetHeight properties.  In a production/developer org these properties give me the correct values but in a sandbox org they give me a value of 0.

 

I've tested my package in two sandboxes - both have the error - and many different developer/production orgs - all of which appear to be fine.

 

I tried to recreate a simple case but it seemed to work in a sandbox - this simple page however wasn't in a managed package.  Is this a bug with sandbox orgs and the managed package interfering with my javascript or am I doing something wrong?

XactiumBenXactiumBen

It seems this was to do with a change in how Winter '10 handles visualforce pages plus some bad code.  Basically there was an id on the apex:page tag that was the same as another tag so when I tried to get the element from javascript it was returning the wrong one.

 

I assume that pre-Winter '10 the apex:page tag was simply stripped out in the generated HTML and post-Winter '10 the apex:page tag was transformed into a span?

Isuru HerathIsuru Herath
I am having the similar kind of issue with google maps. The goole map does not show full screen button on sandbox, but on production full screen button is visible. This behavior is applicable for google chrome. In addition if you visit the page using MS Edge, the behavior is up side down.