/    Sign up×
Community /Pin to ProfileBookmark

Javascript strange error

hi!
i’m pretty new to web programming and programming in general.
i want to make a web page with various languages (english, italian, croatian…etc)
i wrote the html for it but i encountered a problem.

i want to make the site remember the language a visitor has set the last time he visited my webpage in a cookie.
and every time before the parsing of the page i want my javascript file to check if the language cookie is set, and if not, to create it and set its value to “english”.
i used jquery and jquery cookie plugin (they are regular included in index.html in the <head><script> tag but the code seems to do nothing!
the strange thing is that in the javascript console of google crome every row of code seems to work correctly but put all togheter they are useless!
here is my code!

THANK YOU! ?

$(window).load(function(){

var language_cookie = $.cookie(‘Languge’);
if (language_cookie == null)
$.cookie(“Language”, “ENG”, {expires: 365})});

$(document).load(function(){
var language_cookie1 = $.cookie(‘Languge’);

if (language_cookie1 == “ENG”)
$(“#table_select_language th”).html(“Select your language”);

});

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Logic_AliJun 19.2013 — [CODE]var language_cookie = $.cookie('[COLOR=#ff0000]Languge[/COLOR]');
if (language_cookie == null)
$.cookie("[COLOR=#ff0000]Language[/COLOR]", "ENG", {expires: 365})});[/CODE]
[/QUOTE]


It''s a language problem.
×

Success!

Help @svidotto spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...