473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Domanda su script che indirizza in base a risoluzione

Imposto qui la domanda che avevo erroneamente impostato in un ng Java.
Qualcuno mi saprebbe dire perchè lo script seguente funziona bene per
risoluzione 800x600, indirizzando alla pagina index_800.htm, funziona
bene per le risoluzioni più alte, indirizzando alla pagina index.htm,
ma NON funziona se la risoluzione è 640x480, nel qual caso presenta la
pagina index.htm?
L'ho provato su 3PC, ma il risultato è sempre lo stesso.
Grazie molte in anticipo a tutti coloro che mi risponderanno
-------------------------

<script language="javascript">
<!--
var s_width ='';
var s_height ='';
s_width=screen.width
s_height=screen.height

if (s_width == "640"){
location.href="index_640.htm";
}

if (s_width == "800"){
location.href="index_800.htm";
}

else {
location.href="index.htm";
Jul 20 '05 #1
1 1209
Dante wrote on 07 feb 2004 in comp.lang.javascript:
<script language="javascript">
<!--
var s_width ='';
var s_height ='';
s_width=screen.width
s_height=screen.height

if (s_width == "640"){
location.href="index_640.htm";
}

if (s_width == "800"){
location.href="index_800.htm";
}

else {
location.href="index.htm";


} // !!!
Molto simplificato :

<script type="text/javascript">
var s_width=screen.width;
if (s_width < 641)location.href="index_640.htm";
if (s_width < 801)location.href="index_800.htm";
location.href="index.htm";
</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dmitry | last post by:
Hi folks! I need to find a way to switch to a different Unix user from within the Perl script that is currently ran unattended. Script must switch user in order to execute proper profile for...
0
by: :crp: | last post by:
This perl script goes through a list of files in IFILE and for each file, it sends it on to sendmail. Attachments need special handling and are signified in the email-file by having a line start with...
7
by: Dr. Know | last post by:
I am working on an ASP page that writes to several databases, ranging from MDBs to x-base. One of the tasks involves using an existing highest value from the DB and incrementing it before...
3
by: caldera | last post by:
hi, I want to add a script(window.open script actually) in global.asax, for example Application_BeginRequest. I used Response.Write but opened page locked however main page doesn't. Main page...
3
by: Michael A. Vickers | last post by:
Hi, Does anybody have a method by which they can read script blocks that have been registered via RegisterScriptBlock or RegisterStartupScript? I'd like to manipulate registered script blocks...
17
by: CES | last post by:
All, I was wondering if their is a way of loading an external script fill from within a script?? <script language="javascript" type="text/javascript"> function test(var){ <script...
1
by: Ciccio | last post by:
Scusate se è la solita domanda ma neanche con San Google ho trovato un esempio di codice semplice che mi facesse capire. Il tasto Button1 con Button1_Click fa tante cose. Da un'altra parte del...
1
by: Jose Reckoner | last post by:
I'm running python 2.3 on Windows XP. Anyone have a quick small script to convert .DT1 and .DEM data to ASCII or some other format? I don't need a viewer. Thanks!
6
by: obeeker | last post by:
"""there is threee directories,one of these is used for the base directory,decided by the user, default is d0""" import shutil #the three directories d0='D:/Program Files/eb/mb/S'...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.