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

  • Home
  • SEARCH
  • 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 6957749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:02:53+00:00 2026-05-27T15:02:53+00:00

My js file var screenwidth=screen.width; var screenheight=screen.height; if(screenwidth == 800 && screenheight == 600)

  • 0

My js file

var screenwidth=screen.width;
var screenheight=screen.height;


if(screenwidth == 800 && screenheight == 600)
{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index860.css" />

}

else if(screenwidth == 1024 && screenheight == 768)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1024.css"  />

}

else if(screenwidth == 1152 && screenheight == 864)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1152.css"  />

}

else if(screenwidth == 1280 && screenheight == 720)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1280_720.css"  />

}

else if(screenwidth == 1280 && screenheight == 768)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1280_768.css"  />

}

else if(screenwidth == 1280 && screenheight == 800)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1280_800.css"  />

}

else if(screenwidth == 1280 && screenheight == 960)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1280_960.css"  />

}

else if(screenwidth == 1280 && screenheight == 1024)

{

    <link rel="stylesheet" type="text/css" href="C:/Users/bugra/Desktop/project_site/indexl280_1024.css"  />

}


else if(screenwidth == 1360 && screenheight == 768)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1360.css"  />

}

else if(screenwidth == 1366 && screenheight == 768)

{

    <link rel="stylesheet"  type="text/css" href="C:\Users\bugra\Desktop\project_site\index1366.css"  />

}

else if(screenwidth == 1600 && screenheight == 900)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1600_900.css"  />

}


else if(screenwidth == 1600 && screenheight == 1024)

{

    <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index1600_1024.css" />

}

else if(screenwidth == 1680 && screenheight == 1050)

{

    <link rel="stylesheet" type="text/css"  href="C:\Users\bugra\Desktop\project_site\index1680.css"  />

}

else if(screenwidth == 1920 && screenheight == 1080)

{

   <link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index.css" />




}

html file

<head>

<script type="text/javascript" src="res.js">
</script> 


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>


<div id="orta"><center>MERHABA BU SITE IPAD PROJESI ICIN TASARLANDI <p> PROJE : LEZZET DUNYASI<p> BURAK KURAL <p> BUĞRA SÖNMEZ <p> GÜRCAN DİNLER <p> BÜKE YOLAÇAN</></div>


</body>
</html>

one of my css

html{
       height: 98%;

    }


body {
    background-color:#000;
    background-image:url(rsz_ipad-template-horiz.jpg);
    background-repeat:no-repeat;
    background-position:50% 50%;
     }



#orta {

       background-color:#CFF;
       background-repeat:no-repeat;
       height:431px;
       width:698px;
       margin-left:602px;
       margin-top:262px;
       font-size:22px;
       font-family:"Courier New", Courier, monospace;
       font-style:oblique;

      }


}

I try to run this html code on my local computer and all files are in the same folder.

When i click html file , ı just see the result of code which is written between .

Firstly i wrote internal js than use external maybe that was the reason but nothing changed.

For another solution , tried to

document.write('<link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index860.css" />');

instead of

<link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index860.css" />

again nothing changed.

I looked at the code but i didn’t see any syntax error in it. I’m new at js so maybe i miss sometihng but i cant find it.

  • 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-27T15:02:54+00:00Added an answer on May 27, 2026 at 3:02 pm

    You messed up javascript with html. You can’t put markup in JS file. If you wan’t print something to page you should use document.writeln('...'). Example:

    if(screenwidth == 800 && screenheight == 600) {
        document.writeln('<link rel="stylesheet" type="text/css" href="C:\Users\bugra\Desktop\project_site\index860.css" />');
    }
    

    Also href in link tag is not right. It should be url. If you want link file from local disk you should write it as file:///C:/Users/bugra/Desktop/project_site/index860.css.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The xml file is having the following structure <?xml version=1.0 encoding=utf-8?> <?xml-stylesheet type=text/xsl href=TestFile.xsl?>
I have the following line in my .gitignore file: var/www/docs/.backroom/billing_info/inv.pl but when I type
This is my ajax post <script language=JavaScript type=text/javascript> var num = 1; function ajax_post(){
I'm using the following regexp to validate numbers in my javascript file: var valid
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
I have the following variable that accepts a file name: var xtr = new
// File: foo.c static int var; void foo() { var++; } // end of
I have DocumentRoot /var/www/test in my .htaccess file. This is causing the apache server
I have a .htaccess file in the root of a website: /var/www/mywebsite/htdocs/.htacess and I
I want to be able to parse file paths like this one: /var/www/index.(htm|html|php|shtml) into

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.