JS Fiddle OnLoad - jsfiddle

My code is working in JS Fiddle but the same code is not running in Dreamweaver.
I have tried using window.onload() function but still not helping. The issue is with the onLoad type in JS Fiddle.

Check the path of your JS library in Dreamweaver,if it is working properly in fiddle then it is supposed to work properly in Dreamweaver.There is the possibility that your code is not getting javascript library path properly.

Related

This JSFiddle is not loading p5.js correctly

This code I have written in my JSFiddle works well in my computer, and it creates a button and loads a sketch each time I press the button. I "loaded" p5.js, p5.dom.js via CDNJS cause p5.js is not available in the javascript frameworks and extensions options. But the behaviour is not being reproduced correctly. What is wrong with it?
Link: https://jsfiddle.net/truxx/uf7y9meq/5/
I tried:
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/addons/p5.dom.js"></script>
You've got a few things going on here. First of all you should really fix your HTML. You've got mismatched and illegal tags all over the place. Please try to fix all of these problems, and properly format your HTML while you're at it.
It also seems pretty strange that you're trying to mix instance and global mode. Why do you have a setup() and mousePressed() function outside of the sketch function, and another setup() function inside the sketch function? What do you expect that to do?
To fix those problems, you need to choose either instance or global mode. This might require you to rewrite some of your code, but your goal should be to make everything consistent instead of using two different modes in one sketch.

SCRIPT5007:unable to get the property 'widget' of undefined or null reference

I'm using dojo-release-1.6.1, facing the mentioned issue when I'm trying my application in IE9. Anybody suggests what could be the reason for the issue. It's working fine in IE8.
In my page I'm using this piece of code:
dojo.require("dijit.form.DateTextBox");
dojo.require("dojox.widget.Calendar");
I'm not shure if dojos Version 1.6.1 supports the IE9.
It looks like only 1,7+ can handle IE9.
Check this out: http://dojotoolkit.org/reference-guide/1.8/releasenotes/1.6.html#releasenotes-1-6
Regards

Extjs 3.2 : Js error in built function "onDocumentReady"

I`m getting js error, after loading below function,
Ext.onReady(function(){
aFunc123([{header:'ss',Fn:'aFunc1(1)'}],"",undefined,{showCheck:true})
})
After coming out of "aFunc123" function,extjs immediatly calls "onDocumentReady" function, problem is, passed arguments are undefined,and also I dont know how it`s getting called.Please check out, for this problem I`m getting error like `"Unable to get property 'apply' of undefined or null reference"`.
Please suggest me what wrong I`m doing here.
I`m using ExtJS 3.2,IE10.
Thanks in advance.
Ext 3.4.1a was released recently to add IE10 support. You can download it from the Ext website. Otherwise, older versions don't have support for IE10.

Javascript code not recognised in Intellij IDEA 12 in scala template for Play 2

I just installed the recently released Intellij IDEA 12, which is GREAT for Play Framework 2.
However, I'm having the following issue: in an HTML Scala template, any JavaScript code enclosed in a <script> tag within the body of the template is not recognised as JavaScript by IDEA, thus not offering code completion and incorrectly showing errors where they aren't. I suspect it is interpreting the code as Scala code, ergo offering incorrect code completion and making it quite painful to write JS in a template.
This issue was not present in IDEA 11.
Any ideas?
Update
I have the JavaScript Support plugin enabled. Simple code completion works fine. However, if I type function (){} to code an anonymous function and hit Enter with the caret between the curly brackets, IDEA does the following:
If I manually fix the incorrectly added }, and write code for the anonymous function, it offers correct variable suggestion for the console.log although it is stil showing errors:
I can't confirm that, I can see that both, Scala and JavaScript completion works properly.
Go to Settings > Plugins and make sure that you have JavaScript Support enabled. After that close and reopen all your views to let the Idea analize syntax once again.
It appears that your function statement is invalid because you did not name your function. The details of what is going on here are answered in this post. I'm not sure of the details of your particular needs, but you might try this syntax instead:
<script>
(function() {
})();
</script>

how begin with appcelerator for desktop (and use the API's)

I've a bit experience with qt+ and creating not so complex web pages, but I don't know how begin with titanium...when I run the default app this work...I can change the index.html like a web page...I can include javascript code and jquery too...very nice...but when I try run api functions I don't know how include these...all examples talk about iphone and a app.js file...I'm trying make a desktop app and don't appear any .js...I can create these but don't work
...in the docs I read things like these:
var win = Ti.UI.createWindow(); var view = Ti.UI.createView({backgroundColor:"red"}); win.add(view); win.open();
I don't know where I've put this code...I try put it inside a javascript inside the html (bad practice!) but it don't work...I put it inside a function onload but don't work neither.....there are any "convention" with the names for the files for this work?...I think this is like create a very dynamic web page but I don't know how work with the api....I see the example "kitchen something" but it wasn't so clear to mee...I see a examples like this:
http://mobile.tutsplus.com/tutorials/appcelerator/appcelerator-using-json-to-build-a-twitter-client/
but seems this work different when is an ipod to when it is a desktp app...I create an app.js (like the tuto) and put my code inside it but it never run...I look the source code and only need create a .js and inside my "home.html" link it..but it don't work...I create a index.js too but it don't work neither
please help..I'm very noob...thanks
Aaron:
This reply kindly brought something that could have been a solution but just made me lose more than 15 minutes of my time, as these first online courses have info about how to create a new project with a default html file, not about the original poster's issue.
The original poster's issue is that he has a new project with an index.html file, but no app.js file.
And he then doesn't understand where he could put the sampe code :
var win = Ti.UI.createWindow();
var view = Ti.UI.createView({backgroundColor:"red"});
win.add(view);
win.open();
... as whatever he puts in app.js is not executed.
The documentation in Titanium Dev Center fails to provide accurate information as it only mentions Titanium Mobile app.js and does not speak of index.html in the application structure.
After some starting experience on Titanium Mobile, I had to work on Titanium Desktop andactually just had the same problem as angel_ang, which brought me here.
So, here is the real answer :
Titanium Desktop applications do not need or start with an app.js file, but with index.html.
Deleting or removing this file never works as it will still be launched from the last build if need be.
Adding anything to app.js will never run as only index.html is run as a starting place.
Something that should have been a solution was found that to the following link:
http://www.youtube.com/watch?v=lgGVNB2nkKc&NR=1
This video is two online courses further from the link supplied by Aaron. At 0.19 seconds exactly, we see the starting code he has added to index.html.
You need to put a ... in your HEAD section, and add a function() there.
You may put the sample code inside this function.
Then you may even set the function to run when you click a button ().
Unfortunately, this doesn't work with me either.
I tried with the example code above but also with the other example (notification) mentioned in the online course.
It just seems that something is deprecated here and many documentations are outdated.
Anyone that could answer to this situation would be very helpful to us and many newcomers.
We just have an index.html that we can't use, instead of a running app.js file.