theHop 18 Newbie Poster

use keyup instead of keypress. just tried it and it worked better.

$('#txtbox').keyup(function() {

var textLen = $(this).val().length;
var textLeft = parseInt($(this).attr("maxlength")) - textLen;
$('#charCount').text(
    textLeft + ' character' + (textLeft == 1 ? '' : 's') + ' left'
);
});
$('#txtbox').keyup();

I added the maxlength attibute to your textbox and just grapped that in the javascript just to make the acript a bit more re-usable.

theHop 18 Newbie Poster

looking at the source, you have forgotten to close the last script tag.

Also. the callback function on your json function seems to be doing alot of document.writes. maybe pick an elementbyid and use innerHTML += instead of document.write.

the only reason I say this is because when I view your source in chrome developer tools the head section is empty. document.write can replace the whole page if fired in the head so deleting the reference to the style sheet.

theHop 18 Newbie Poster

I recently undertook a development job where i needed to create a music player. We decided that the music should be managed from soundcloud.com (let them deal with the storage band width). There was one problem. to make it work in ALL modern browsers there needed to be be at least and MP3 version and an ogg version of each song. Of course soundcloud only provides an mp3 stream. So you wouldn't get any sound in Firefox.

after some trial and error with this. I eventually realised that if I uploaded the songs as ogg files and set it so people can download the song, I could use the download_url for the ogg format and still use the stream_url as the mp3.

This does actually work!.

Just thought it might help someone.

theHop 18 Newbie Poster

How about

str = str.replace(/\u0160/g,"");
riahc3 commented: That was it +4
theHop 18 Newbie Poster

what are the commas for? plusyou have missed a forward slash on image path. this May work

function nxtimg(country){
  document.getElementById("imgcont").src="images/" + country + "/" + imgs[i] + ".jpg";
  i++;
}
theHop 18 Newbie Poster

I've ended shortening then script at the same time. I swapped your textarea out in favour of a div and put all your urls in a object literal. (could have been an associative array. Makes no difference really.

<script type="text/javascript">

links = {
        A:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I21263C4FA139C15D7BAC/ical.ics",            
        B:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212NEKA9Y139E57D8DDA/ical.ics",
        C:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212WPEPUP1396F85E02B/ical.ics",
        D:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212NEKA9Y139E57D8DDA/ical.ics",
        E:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212ETT9PK139C15F2C25/ical.ics",
        F:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212Y6WMF4139C1C22637/ical.ics",
        G:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212AT4NRY139C165DB97/ical.ics",
        H:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212XH7AWH139C160ED75/ical.ics",
        I:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I2123X6H36139C1C1A4E5/ical.ics"    
};

function fifa()
{
    var link = document.getElementById("link");
    var frm = document.forms[0];
    var abc = frm.browsers.value;
    link.innerHTML = "<a href=\"" + links[abc] + "\">" + links[abc] + "<\/a>";
}
</script>
</head>
<body>
<center>
<form name="form1">
Subscribe to your calendar link:
<select id="browsers" onchange="fifa()">
<option value="0">- choose a tutor -</option>
<option value="A">Ashley C.</option>
<option value="B">Danielle C.</option>
<option value="C">Jon S.</option>
<option value="D">Mekenna M</option>
<option value="E">Norma C.</option>
<option value="F">Tyler K.</option>
<option value="G">Vanessa A.</option>
<option value="H">Veronica G</option>
<option value="I">William K.</option>
</select><br><br>

<div id="link" style="width:400px; height:100px;">
</div>
</form>
theHop 18 Newbie Poster

no global variables neccesary

<script>

    function toDays(years) {
       var time = 365 * years;
       return time;
    }
    document.write("My age is " + toDays(21));
</script>
Taywin commented: Good example +11
theHop 18 Newbie Poster

@andyy121

Arguments with other members aside, did correcting the spelling mistake solve the issue?

P.S remember. People who post answers on here are usually IT proffesionals that would normally charge a small fortune for the type of consultancy provided in here. yet they do it here for free. This can sometimes be a bit of trial and error which means people will sometimes give the wrong answer but not intentionally.

LastMitch commented: Right on Target! +3
theHop 18 Newbie Poster

No problem...I have fell for that a few times. I think it was with background images too. glad you got it sorted. Please vote up my answer and mark as solved. : )

kevwood commented: great response. +0
theHop 18 Newbie Poster

So if I understand correctly, your folder structure is as follows.

index.html
css/main_style.css
images/buttons/main_link_bg.png

your css seems fine to me. the url function in css is relative to the css file it self. The only thing I can think is maybe the browser is loading cached versions of your other pages. Have you tried to refresh on the other pages. sometimes it's worth holding down the refresh key to get to force a new version of the page. Or just try them in a different browser to see if the BG image is still missing