Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Функиция которая читает и записывает в куки
function checkCountry() {
var country = $.cookie("ad_country");
if ( country === undefined || country === "error" ) {
type: "GET",
url: "",
callbackParameter: 'callback',
dataType: "jsonp",
timeout: 10000,
success: function(json){
$.cookie("ad_country",, {expires: 7} );
error: function(){
$.cookie("ad_country", "error", {expires: 7} );
return country;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.