Is p5.js working on codepen? - javascript

I am testing my p5.js work on codepen but doesnt work.
Can you help why this doesn't work?
test page

The CodePen link in your comments works fine for me:
The link in your post looks like this:
...ah, I see now that there is a CodePen on that page that isn't loading. (You should really try to be more specific about exactly what you're seeing, this is why you're getting downvotes and confused comments.)
To debug that, you need to open the developer tools and look at the JavaScript console. You have a bunch of errors there that you need to fix.
Note that the CodePen you link in your page is different from the CodePen you've linked in the comments. The CodePen in the comments ends with GMZwyL, but the CodePen in your page ends with wrWJpg. If I go to that and look at the JavaScript console I see an error about not being able to load an image, and all I see is a blue screen.
You need to debug your program and make sure you look at all of the errors being generated.

Related

Javascript alert pop up window isn't displaying except on embeded code and code written on Chrome browser developer console

If this question is inappropriate on this site, please tell me where I should ask this question.
alert("Hello World!");
I have ran this simple code on codepen JS editor and Chrome developer console for hundreds of times and it has worked. It also had no problems running as an embeded code on the tutorial website I was following.
However, for some reason I'm getting no response (i.e. no modal window popups) when I try to run the alert code above on Codepen and JSFiddle. However it works on js.do online javascript editor, Chrome developer console, and the tutorial website I've linked above.
Please note that I've tried using different browsers, changing site settings, and even restoring browser settings and clearing browser data.
I usually use Codepen while I'm learning JavaScript, so I want to know what's the problem.
It seems there can be a new browser restriction. If I try to add an alert to Codepen and look to the Chrome console I see this warning:
A different origin subframe tried to create a JavaScript dialog. This is no longer allowed and was blocked. See https://www.chromestatus.com/feature/5148698084376576 for more details.

Why won't my javascript code work in a HTML file?

Hi I am new to coding and trying to learn webb developpment. I were following and looking at a tutorial making a hamburger menu but cant get the javascript to work. Am I doing somthing wrong or have a forgot to download somthing in Visual studio code beacause i can't find any erors in the code.
HTML
CSS
CSS
Your spelling document wrong
var More = dokument.getElementById('More');
...
Javascript is annoying and will silently fail when an error happens. To view the errors hit f12 in your browser and go to the Console tab, they should show up in a big red banner :)

Personal toolbar button in Forge Viewer not appearing

I followed the tutorial to learn Autodesk Forge. I linked my BIM 360 account to the Forge Viewer. I would now like to add extensions to it and have a button on the toolbar that links to my extensions.
However when I follow the extension tutorial, nothing shows up. I also tried this one https://forge.autodesk.com/en/docs/viewer/v5/tutorials/toolbar-button/#before-you-begin and nothing appear.
I do not know what I am doing wrong since it seems to work if we follow the tutorial...
I am working on VS code
Right now, my code looks like this in the index.html file :
enter image description here
The rest is exactly like the tutorial except that I replaced "MyAwesomeExtension" with "PieChartExtension"
One thing to try will be to switch your var config3d to the following:
var config3d = {extensions: ['PieChartExtension']}
The reason might be, your syntax might be affecting and that is why the Viewer does not understand what to load. Did you check the console for any messaging?

FullCalendar plugin dayClick not working

I've been trying to get the dayClick in the FullCalendar plugin to work, but when I click nothing is happening. Can't figure out what it is I'm doing wrong. I click on a day, but no alert message. jsfiddle below. What am I doing wrong.
http://jsbin.com/bicawa/2/edit
I don't really know this library but you had two non-related issues in your code:
The moment script tag was placed before jQuery, my guess it should be placed after.
You had four slashes in your moment src (i.e. src="https:////...")
After fixing these two issues I got the console.log to work, but for some reason the alert() still wasn't working.
alert is turned off in JSBin. You shouldn't debug with alert because it stops code execution. While JSBin is a great tool for building quick samples, it makes debugging harder.
And as #idoberko2 says: You should put jQuery as first included script.
Here is a working JSBin

debugging jQuery snippet

I was trying to take a working jQuery snippet (it's an example to another SO answer) and improve it.
The original snippet can show a good and a bad way of doing something, by having to comment/un-comment some code. I tried to modify the HTML and the JS so that both examples can be run independently, without modifying JS code (by basically cloning sample HTML into a copy with different IDs).
Original JSFiddle worked fine: http://jsfiddle.net/thangchung/LVAaV/
My "improved" version doesn't seem to work at all: http://jsfiddle.net/dvkdvk/C2YBE/19/
(doesn't work means that when you push any button, nothing happens).
I don't know how to debug it with jQuery (with regular JS I would just sprinkle alert() everywhere). I ran "JSHint" on JSFiddle and it was OK.
Your new fiddle did not select a library. Select it from the left side of the form and click Run.
I found this by using Firebug's script debugger in Firefox. Turn on script debugging with the developer tools in your browser of choice. Otherwise, Javascript fails silently. You can then set breakpoints, look at variables, etc. That is much more efficient than using Alerts and console logs (although they do have their place).
Your main problem is with your JSFIDDLE setup. On the left hand side of the page, make sure you include the jQuery library and select onDomReady from the frameworks and extensions panel.
I tried running this script in FireFox, Firebug. The scrips runs fine here with me. Kindly see the environment in which you are trying to run this script.

Categories

Resources