user2209033
user2209033

Reputation:

Checking a website is accessible JQuery / Javascript

I am trying to use Javascript, to ping a website, and display a result from this.

I have set up this JSFiddle, but no luck so far. - https://jsfiddle.net/yyjowtru/

I feel this is really close, but it seems if I change the following code (the url), nothing seem's to change.

    // Check if we can see site
$.Ping("http://www.google.com").done(function (success, url, time, on) {
    // Insert an extra menu item linking to the sign-in page
    $("#menu-main-menu").append('<li><a target="_blank" href="#">Sign in</a></li>');
    // Change the width of an li to accommodate the extra menu item
    $(".navbar li").css("width", "14.2857%");
});

Can anyone see anything obvious?

Thanks in advance

EDIT Screenshot of my JSFiddle enter image description here

Upvotes: 1

Views: 136

Answers (1)

bipen
bipen

Reputation: 36531

Well you forgot to load jQuery in the fiddle. Load it and it should work. try this fiddle

Frameworks & Extensions > choose jQuery version you want to load

https://jsfiddle.net/yyjowtru/1/

Upvotes: 1

Related Questions