Help with wikipedia viewer challenge

Hey Guys! I am having a bit of a challenge with my Wikpedia viewer. Cant get the API to work. Would appreciate any help and possible solutions. Thank you

Javascript Code:


var searchItem = $("#searchItem").val();

  url: "",
  dataType: "json",
  data: {
    action: "opensearch",
    format: "json",
    origin: "*",
    search: searchItem,
    formatversion: "2", 
    success: function(data){
    error: function(errorMsg) {


//Enter Keyboard click


The success and error functions shouldn’t be inside the data object.

Thank you so much guys, but after making the changes API call is still not working and I keep getting this error logged on my Web Console (Firefox):

“An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing”

Dont understand what it means. Thanks again guys

Thank you so much SkyC, returning API calls now. You have been extremely helpful, cant thank you enough. God bless you.