Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Can anyone help why my javascript wont work on codepen

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #241508
    rabdhir16
    Participant

    I am new to javascript, and also new to codepen. When I click on browser refresh, it tries to reload, but only the html portion is working. Here is a link to my codepen. Thank you.

    https://codepen.io/rabdhir2016/pen/QNoEzQ

    #241509
    Senff
    Participant

    From what I can see, the Javascript is loading fine; whenever I enter something in the field and click the button, some data is being shown in the console.

    #241513
    rabdhir16
    Participant

    Thank you. That’s encouraging!. But why can’t I see it on my browser. I must have miss something. Do I have to be a codepen PRO to be able to see the data. I will check it out from another computer on the public network, if it works, than it must have something with codepen not allowing the data to display on my browser.

    #241518
    Senff
    Participant

    You don’t have to be a PRO member to see the data.

    The only place where the data appears though, is the console. Did you try other browsers?

    #241527
    rabdhir16
    Participant

    I try firefox and then chrome, nothing got displays on the console.

    #241541
    Shikkediel
    Participant

    I suppose the issue is that you can’t make a cross origin Ajax request on Codepen like that…

    #241547
    Senff
    Participant

    It’s still totally working for me though. I enter something in the search box, hit the Submit button, and the results show up right away.

    #241558
    rabdhir16
    Participant

    It was a syntax error for my url in the ajax function. I had it as “action=openSearch&search=” instead of “action=opensearch&search=”. It is working now.

    #241564
    Shikkediel
    Participant

    How odd, @Senff. Even with the right url, I’m still getting errors. Wondering why that isn’t the case with your setup…

    #241571
    rabdhir16
    Participant

    I took my code for a review at freecodecamp gitter.im yesterday. Someone pointed out that I had to change the lettercase from openSearch to opensearch. I did that and it starts working. I can see the console display right away.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.