Google chart : Container is not defined when html changes - html

I'm getting the error "Container is not defined" after I click on a different page while the api is loading.
I'm sure that my
var chartTwo = new google.visualization.PieChart(document.getElementById('donutchartDue'))
is working because the error doesn't pop up if I just wait on the same page until everything is loaded.
I believe the cause of this error is that my chart div is no longer there when my template changes while api is running in the background (basically html and apis are asynchronous). =(
Anyone got any idea on how to fix this?

Nvm guys, I used if (angular.element('#donutchartId').length) {} to check if the div exist before the charts get drawn and it worked

Related

A pop-up window that used to open through the console stopped opening

Hi everyone
I just started learning HTML so I barely understand what I'm doing, sorry in advance.
So basically, there used to be an option to delete your account from a website by going to the console and writing a specific line.
You used to simply type:
profileModule.openDeletAccountModal(); and a pop-up window would open that asks you to re-enter your password and that's it.
However, lately they changed something and after writing down that line nothing opens up and instead you get:
Uncaught TypeError: Cannot read properties of null (reading 'style')
at Object.openDeletAccountModal (profile.js?v=1.34120.518:1:1001)
Inside the .js you get some more lines:
var profileModule=(function(){var _showRemoveProfileLink=function(){var urlParameterToShowRemoveProfile='removeprofile';var url_string=window.location.href;var url=new URL(url_string);var c=url.searchParams.get(urlParameterToShowRemoveProfile);if(c!==null){document.querySelector('#ask-delete-account').style.display='block';if(c==='open')openDeletAccountModal();}};var handleEvent=function(){_showRemoveProfileLink();var btnDeleteEl=document.querySelector('#btn-delete-account');document.querySelector('#delete-account-current-password').addEventListener('input',function(event){if(event.target.value.length>0){btnDeleteEl.classList.remove('disable-button');btnDeleteEl.removeAttribute('disabled');}else{btnDeleteEl.classList.add('disable-button');btnDeleteEl.setAttribute('disabled','');}});document.querySelector('.dark-nilon').addEventListener('click',function(event){profileModule.closeDeletAccountModal();});};var openDeletAccountModal=function(){document.querySelector('.delete-account-modal').style.display='block';document.querySelector('.dark-nilon').style.display='block';};var closeDeletAccountModal=function(){document.querySelector('.delete-account-modal').style.display='none';document.querySelector('.dark-nilon').style.display='none';};var hashPasswordsDelete=function(currentpassword,currentpassword_md5){var junk_output;md5hash(currentpassword,currentpassword_md5,junk_output,0);};return{handleEvent,openDeletAccountModal,closeDeletAccountModal,hashPasswordsDelete};}());document.addEventListener("DOMContentLoaded",function(){profileModule.handleEvent();});
Any way to find out what's going on? Thanks!

Uncaught ReferenceError: ProductMediaManager is not defined easylife switcher magento 1.9.3

I have installed easylife switcher in magento. Everything is working fine except the image is not showing correctly. It is zoomed image and I am unable to zoom in or zoom out.
I have selected the option of switch all media section as switch main image is not working at all.
Please help!!
I have found the answer by myself after struggling with the code. There is nothing wrong with easylife switcher. The thing is that according to your theme you have to add code. So for generating thumbnails in my theme bxslider was used. So, I just initialized that along with existing code in JS callback.

How to use Selenium web browser to post in salesforce

My friend recommended Kantu for work automation hence I'm trying it out but couldn't seem to find the answer to my question on the web.
I'm new at coding, automation, stackoverflow and this is my first post.
Have just installed Kantu for Chrome- Selenium IDE Light and am trying to automate a daily post message within salesforce.
However, have received this error when I try to click on the message box.
[error]
time out when looking for element '//*[#id="outerContainer"]/div[1]/div[1]/div[1]/p'
When I click on inspect, I find this code for the message box:
I've tried running the Test Case demos and everything seems to be able to run well without problems. Noticed that the key difference in the Selenium IDE demos are that the text boxes are fixed (i.e. constantly appearing on the pages) whilst the text boxes within salesforce only appear when clicked upon.
Have tried to add in macros to click on the text div box within salesforce but Selenium doesn't seem to be able to record the click part hence unable to insert any texts into the salesforce.
Hope someone can help.
Many thanks in advance, happy new year!

Created a hyperlink on a button however it only work on the first click then stop working

I'm new to flash. I am using Adobe Flash Professional CS6. I have created a menu bar with a drop down menu and rollovers to change the colors.
I have put the the code (below) on the background and then given the button the instance name of 'navbarbtnhome'.
navbarbtnhome.onRelease = function() {
getURL("http://www.google.com", "_self");}
After i publish and open the HTML file the hyperlink will only work for the first click, after that I have to amend the code in some way and then publish and open it again, then the hyperlink will work another time until I repeat the process. Can anyone help, I'm totally lost for ideas now after trying for hours. my full menu bar is here if anyone wants to help.
Thanks.
It seems as though getURL doesn't work when testing your file locally, due to security sandbox restrictions. Assume that the links work, and upload it to your server and then test it -- hopefully it will work that way :)
Source: getURL not working on HTML export (Actionscript2.0)

"Does not make sense to draw an image" - Warning after upgrade to MountainLion

After I upgraded my programming machine to MountainLion and XCode to the new version I get this warning printed into the console everytime I run my application:
It does not make sense to draw an image when [NSGraphicsContext
currentContext] is nil. This is a programming error. Break on void
_NSWarnForDrawingImageWithNoCurrentContext() to debug. This will be logged only once. This may break in the future.
I'm not using an Image anywhere in my Application and I searched the whole project for an image but couldn't find one. Does anybody know what could cause this?
I'm using 2 nib files btw: One Popover and the Mainwindow. Neither of them contains an image.
Edit:
I found the line when this appears:
[self.popover showRelativeToRect:[appDelegate.menulet frame]
ofView:appDelegate.menulet
preferredEdge:NSMinYEdge];
But none of those object is nil. Any suggestions?
Edit 2:
The Menulet is a NSView subclass btw. So I'm passing a view.
I tried setting the breakpoint but it is called when the nib loads. So it is very non-specific. I created a copy of the nib and then deleted objects from it one by one until the warning went away. In my case, it was an NSOutlineView. But as as soon as I added a new NSOutlineView, the error came back.
I was finally able to remove the warning by rebuilding the entire NIB by hand. Painstaking but it got rid of the warning.
If you have a NSImageView that's initialized in the nib but with no image set (and you draw the image yourself in code) just set it and the warning will be gone.
In my case, it's because the image size is {0,0}, which "doesn't make sense".
Actually, the image is for a NSButton, I change the button's image programmatically. In one case, the button should be empty, so I just set an empty image with [NSImage new].
But the error occurs, then no matter how I change the button's image, the button is always empty.
After setting a size to the empty image, the problem is solved, and I can change the button's image successfully.
In my case the warning resulted in rewriting my menuIcon with a rectangle (Working on a menuBar application). Haven't solved the problem yet, but I know where it came from in my case. If you have a menubar application, check the code which generates your icon.