Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6232985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:12:58+00:00 2026-05-24T10:12:58+00:00

I can’t seem to get this code working. Im trying to make it so

  • 0

I can’t seem to get this code working. Im trying to make it so that if the browser is IE6 or lower it will use “horarios2.png” for the img src and no other. And if its any other browser that it will check the weekday(0-6) so that it will fill in the specific image for each day. From Monday(1) to Wensday(3) the image is suposed to be “quarta.png”. The other day’s have their own image. They work seperatly but when I try and put them together I get in trouble and it dosen’t render the image.

Script

$(document).ready (function horario () {
var date = new Date();
var weekday = (date.getDay());

function (msieversion) {
var ua = window.navigator.userAgent
var msie = ua.indexOf ( "MSIE " )

if ( msie > 0 )
     return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
else
     return 0
}
if ((msieversion() == 0 )&&(weekday==0)) {
    document.getElementById('horarios').src = "img/domingo.png";}
else if ((msieversion() == 0 )&&(weekday==4)) {
    document.getElementById('horarios').src = "img/quinta.png";}
else if ((msieversion() == 0 )&&(weekday==5)) {
    document.getElementById('horarios').src = "img/sexta.png";}
else if ((msieversion() == 0 )&&(weekday==6)) {
    document.getElementById('horarios').src = "img/sabado.png";}
else if((msieversion() <= 6 )&&(weekday>=0)) {
    document.getElementById('horarios').src = "img/horarios2.png";}
else {
    document.getElementById('horarios').src = "img/quarta.png";}
});

HTML

<img id="horarios" border="0" alt="" width="343" height="45" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:12:59+00:00Added an answer on May 24, 2026 at 10:12 am

    Here is what I think you meant DEMO HERE (mouseover the image)

    function msieversion() {  
      var ua = window.navigator.userAgent
      var msie = ua.indexOf("MSIE ");
      return (msie == -1)?0: 
          parseInt(ua.substring (msie+5, ua.indexOf (".", msie )))
    }
    function getImg(idx) {
      return [
      "img/domingo.png",
      "img/quarta.png",
      "img/quarta.png",
      "img/quarta.png",
      "img/quinta.png",
      "img/sexta.png",
      "img/sabado.png"
      ][idx];
    }
    $(document).ready(function() {
      var weekday = new Date().getDay();
      if (msieversion() == 0 ) $("#horarios").attr("src",getImg(weekday));
      else $("#horarios").attr("src",(msieversion() <= 6 )? "img/horarios2.png":"img/quinta.png");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use a temp directory that will be unique to this build.
Can I get a 'when to use' for these and others? <% %> <%#
Can I use the following across all browsers? <a href=# onclick=doSomething()>Click here.</a> Is this
Can i get the source code for a WAMP stack installer somewhere? Any help
Can somebody point me to a resource that explains how to go about having
Can a LINQ enabled app run on a machine that only has the .NET
Does anyone know how can I replace this 2 symbol below from the string
Can anyone tell me what's wrong with this robots.txt? http://bizup.cloudapp.net/robots.txt The following is the
Can I connect to a Ubuntu server, that is running MySQL using ADO.NET or
Can anyone pls let me know the exact c++ code of case sensitive comparison

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.