Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Jul 2015
    Location
    Romania/Galati
    Posts
    1
    Member #
    51256

    Red face Link an external css file problem.

    I have two problems withing html file.. so i will post both here.. i don't wanna post same problem in two sections.

    So first one...

    Now i have like this :
    Code:
     <link href="main.css" rel="stylesheet" type="text/css" />
    the call works but if i change to
    Code:
    <link href="css/main.css" rel="stylesheet" type="text/css" />
    now the main.css is in the "css" folder it doesn't work anymore... why?

    Same problem i got with the js file.

    If i put the script inside html file with the tags
    Code:
    <script type="text/javascript"> the code </script>
    it works
    but if i try to call in html file like this :
    Code:
    <script type="text/javascript" src="timer.js"></script>
    it does't work anymore.

    The whole js code :
    Code:
    var current="Coming Soon!";       
    
    var year=2016;       
    
    var month=12;         
    
    var day=21;         
    
    var hour=18;        
    
    var minute=38;      
    
    var tz=-5;          
    
    
    
    var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
    
    
    function countdown(yr,m,d,hr,min){
    
    theyear=yr;themonth=m;theday=d;thehour=hr;theminute=min;
    
    var today=new Date();
    
    var todayy=today.getYear();
    
    if (todayy < 1000) { todayy+=1900; }
    
    var todaym=today.getMonth();
    
    var todayd=today.getDate();
    
    var todayh=today.getHours();
    
    var todaymin=today.getMinutes();
    
    var todaysec=today.getSeconds();
    
    var todaystring1=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec;
    
    var todaystring=Date.parse(todaystring1)+(tz*1000*60*60);
    
    var futurestring1=(montharray[m-1]+" "+d+", "+yr+" "+hr+":"+min);
    
    var futurestring=Date.parse(futurestring1)-(today.getTimezoneOffset()*(1000*60));
    
    var dd=futurestring-todaystring;
    
    var dday=Math.floor(dd/(60*60*1000*24)*1);
    
    var dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1);
    
    var dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
    
    var dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
    
    if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=0){
    
    document.getElementById('count2').innerHTML=current;
    
    document.getElementById('count2').style.display="inline";
    
    document.getElementById('count2').style.width="390px";
    
    document.getElementById('dday').style.display="none";
    
    document.getElementById('dhour').style.display="none";
    
    document.getElementById('dmin').style.display="none";
    
    document.getElementById('dsec').style.display="none";
    
    document.getElementById('days').style.display="none";
    
    document.getElementById('hours').style.display="none";
    
    document.getElementById('minutes').style.display="none";
    
    document.getElementById('seconds').style.display="none";
    
    document.getElementById('spacer1').style.display="none";
    
    document.getElementById('spacer2').style.display="none";
    
    return;
    
    }
    
    else {
    
    document.getElementById('count2').style.display="none";
    
    document.getElementById('dday').innerHTML=dday;
    
    document.getElementById('dhour').innerHTML=dhour;
    
    document.getElementById('dmin').innerHTML=dmin;
    
    document.getElementById('dsec').innerHTML=dsec;
    
    setTimeout("countdown(theyear,themonth,theday,thehour,theminute)",1000);
    
    }
    
    }
    
    
    countdown(year,month,day,hour,minute);



    Edit: The css one i solved but the js one i haven't
    Last edited by Pascal Mihai; Jul 24th, 2015 at 04:30 AM.

  2.  

  3. #2
    Junior Member ynef's Avatar
    Join Date
    Jul 2015
    Location
    Tallinn, Estonia
    Posts
    8
    Member #
    51156
    The only thing I can suggest is to double and triple check whether you got the folders and paths right.

    Try putting the full URL of the file in there and see if that makes a difference?

    Like: http://yoursite.com/folders/if/any/timer.js

  4. #3
    Banned
    Join Date
    Jul 2015
    Posts
    16
    Member #
    50993
    Liked
    1 times
    if you are using this <script type="text/javascript" src="timer.js"></script> it means that your js file have to be in the same dir with your html file.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Tags for this Thread

All times are GMT -6. The time now is 04:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com