How to attach Jquery in CodePen Debug mode?

Uncaught Error: Bootstrap’s JavaScript requires jQuery
at bootstrap.min.js:6
Uncaught ReferenceError: $ is not defined
at XxrVwDpGGOgA:92

Do you have a working example? It’s easier to debug with actual code.

At first glance, it looks like you haven’t included jQuery in your pen. It isn’t included by default and it has to come before bootstrap.

Hi. I have the same thing you have in image. It works fine in editor mode. When I open in debug mode(codepen has this option on top right corner), a new tab opens with only the HTML page, that is where I get the issue of missing jquery

That is very curious. The only think debug mode should do is remove the codepen header and wrapper.

It seems to be working for me. My portfolio project:

Full View:
Debug View:

Would love to know if you’re getting that error with other pens like mine or just yours. If it’s just yours, we’ll need to see the actual pen in order to help further.

Please take a look at this

Wikipedia Viewer:
Debug mode:

Another issue is the API fails often, after I try for 4-5 times I get result once.
And also I am trying to append the result divs but that does not work either. It looks like something is overwriting when I happen to get result from API.

Found it… I think. Took forever.

You, my good friend, are missing a closing angle bracket. Close the tag, and your debug works. :slight_smile:

Have a look:
Corrected that. I don’t think that was the issue.

I don’t see the jQuery error anymore (just an image from another site warning). Are you still seeing it?

Sorry.Now it’s gone. I should have posted the snapshot.
Can you see why the data is not getting appended. it looks like it is being overwritten.

Your form is being as a submit… which assumes that you’re going to another page, so it refreshes before your script can be called. You can stop this with a single line.

    if (e.which == 13) {
      e.preventDefault(); // this is the line you should add

Once I did that, it all popped into place. :slight_smile:

1 Like