Cannot Get vacancy.js To Work

I’ve found a cool neon sign jquery thing to use as the title of my little project, however I cannot get it to flash like in the demo.

Below are the links where I discovered it:

http://chuckyglitch.twbbs.org/novacancy/

This is my (unfinished) site:

http://www.worldofwinfield.co.uk/

Can anyone work out what I am missing? Normally it is a source file but they seem to be all there. I’m still very much a beginner so likely to be something dumb.

Thanks
James

You have to put the source of jQuery first, I believe.

Oh, and only once. Not twice. You’ve got a link to the CDN for jQuery, then it looks like you’re including a local version, too.

HTH,

:slight_smile:

If you open your browser’s console, you’ll see you’re getting some errors. The first one is caused by the first line of your code.js file:

void setup() { 
  size(400, 400); 
} 

This isn’t valid syntax for declaring a function in JS. You want to be doing it one of two ways:

function setup() {
  size(400, 400);
}

or

var setup = function() {
  size(400, 400);
};
2 Likes

FYI, if you come from a Java background (which void is valid), then you should realize Javascript is completely different :slight_smile: .

1 Like

Yes, sorry @jamesthemonkeh, but Java is not a language that we deal with here.

For help with programming Java, I suggest that you look at one of the Java forums such as Java Programming Forums or Java Forums

Thanks guys. It doesn’t actually get the flashing sign working still, but at least some other errors are fixed!

I’m glad that you qualified that with “some”. Here are some more errors from your page to get fixed:

code.js:1 Uncaught SyntaxError: Unexpected token {
jquery.novacancy.js:266 Uncaught ReferenceError: jQuery is not defined
www.worldofwinfield.co.uk/:20 Uncaught TypeError: $(…).novacancy is not a function

Well I’m massively a beginner so takes me ages to work out the simplist things so there will always be errors! For now anyway.

The error I get now is:

Uncaught TypeError: $(...).novacancy is not a function

This is because, as WolfShade pointed out above, you’re loading a second copy of jQuery after the novacancy.js plugin. If you remove the second jQuery script tag, it should fix the error.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.