Finding out about window size

Hello
I'm trying to find out the window size of the browser
visiting my web site. There is several javascript codes but I'm
wondering whether there is anything in CF? I checked CFlib and
unfortunately didn't find anything....
At the end I would like to have the width and height
available for further use. My problem (because I'm a rookie) is to
take this information out from javascript to a CF variable (or
structure or whatever).... Thats why I prefer not to use javascript
at all ;-)
Is there an easy solution?
Thank you very much

>
> Thanks for further inputs.
>
Play with this code a bit.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
<!--
function Box(){
var viewportwidth;
var viewportheight;
// the more standards compliant browsers
(mozilla/netscape/opera/IE7)
use window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined')
viewportwidth = window.innerWidth,
viewportheight = window.innerHeight
// IE6 in standards compliant mode (i.e. with a valid
doctype as the
first line in the document)
else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth
!= 0)
viewportwidth = document.documentElement.clientWidth,
viewportheight = document.documentElement.clientHeight
// older versions of IE
else
viewportwidth =
document.getElementsByTagName('body')[0].clientWidth,
viewportheight =
document.getElementsByTagName('body')[0].clientHeight
alert('Your viewport dimension is '+viewportwidth+' x
'+viewportheight+' pixels');
document.cookie =
'windim='+viewportwidth+'|'+viewportheight+';
expires=Fri, 24 Oct 2008 00:00:00 UTC; path=/';
//-->
window.onload = Box();
</script>
</head>
<body>
<cfoutput>
<h1>Fun with window sizes</h1>
Diminsion Cookie
<cfif structKeyExists(cookie,"windim")>
<p>Your viewport dimension is
#listFirst(cookie.windim,'|')# x
#listLast(cookie.windim,'|')# pixels</p>
</cfif>
<p><a href="#cgi.SCRIPT_NAME#">Click here to
update windows
diminsion.</a></p>
</cfoutput>
</body>
It is important to note the order of things. When this page
is first
ran the JavaScript gets the dimensions and writes the
cookies.
When it is run again ColdFusion reads the cookies that from
the previous
request and then the client gets it and runs the JavaScript
again
updating the cookie.
I.E. JavaScript is always outputting the current dimensions,
ColdFusion
is output the *last* dimensions. Play with this page by
changing the
browser size and then clicking on the link.
If you wanted more immediate feed back replace the
document.cookie line
in the javascript with a call to a ajax function that sends a
request
immediately to the server.
It'll have to wait for different day for me to have time to
whip up an
example like that.

Similar Messages

  • I have two graphics cards in my PC . after I had to reinstall windows again has been slower pc and stuff not play 4k footage . Can you help me find out about it " Raks " graphics card has stopped working ?

    I have two graphics cards in my PC . after I had to reinstall windows again has been slower pc and stuff not play 4k footage . Can you help me find out about it " Raks " graphics card has stopped working ?

    I'm not aware of any, not to say that there aren't any issues.
    it may have nothing to do with ntpd, there are a lot of things running.
    ntpd just happen to make the log entry at the same time as the panic.
    I would check to see if there are any updates available for you system.
    if this is the first time that this has happened. it may be (pick one):
    cosmic rays
    sun spots
    the trilateral commission
    if this happens more frequently and that traces look the same, then
    there may be a real problem that needs to be looked into further.

  • How can i find out the file size of a Keynote on an iPad please?

    How can i find out the file size of a Keynote on an iPad please?

    I think a rule of thumb is what you're looking for.
    Full bandwidth CD audio (AIFF): about 10 MB/min
    Apple Lossless: about 5 MB/min
    MP3 @ 256k: about 2 MB/min
    MP3 @ 128k: about 1 MB/min
    Of course the MP3 file size is exactly linear with bit rate.
    As for sound quality:
    Apple Lossless is, as the name says, lossless.
    MP3 @128k: fine for listening in the car or the kitchen etc. If you have an audiophile sound system, this will remind you why you spent all that money.
    MP3 @256K: barely distinguishable from CD on very good equipment.
    MP3 @320K: probably not distinguishable from CD.
    I presume that since you're talking about importing classical CDs these are ones you own. Remember you can always do it again if you need higher fidelity or if better technology comes out. I import most CDs at 128k, since most of my MP3 listening is in the car, or walking, or as background. And I can always play the CD if I want to sit and listen.
    The logic for purchased music is totally different -- you probably won't get to upgrade that without buying it some different way. So buying 128k MP3s (or AACs) is something you'll probably regret later. Buying 256k MP3s is a lot less problematic.

  • How do those who don't watch boards find out about firmware updates?

    Since 'Software Update' doesn't alert users to firmware updates, I wonder how those that don't monitor these boards and other 'Mac news' sites find out about firmware updates?
    Yes, Boot Camp made headline news in many major newspapers and those who wanted to install it found they needed to update the firmware first.
    But, had I not read about it elsewhere earlier, I would not have known about the second MBP firmware update (which, apparently, solves some of the 'whine' issues - I've had no whining but I like to keep my firmware, in particular, up to date!).
    Just as a note to Apple - you've a database of all who have registered their MPB's (at least those with AppleCare if not those who simply run set-up with new Mac purchases). If firmware updates aren't included in the 'Software Updates' procedure, shooting off an email to those with machines that might be in need of firmware updates may save a world of grief to overworked phone support techs.

    Yes, I'm familiar with the support page but my point is that not all (in act, likely very few) are familiar enough with that page to go to "Top Downloads" to find firmware updates.
    On page 25 of the MacBook Pro Users Guide, Apple DOES suggest, in the next to the last paragraph, suggest "For support information, user discussion boards, and the latest Apple software downloads, go to www.apple.com/support."
    But if a new user is having problems he or she is more likely than not to pick up the phone first - and although there's the 90-day phone support and 3 year phone support for those who purchase AppleCare (which new users may not - particularly if buying from, say, CompUSA or other stores who push 'extended warranties' even with the purchase of products whose manufacturers already provide LIFETIME warranties) Apple has thoughtfully provided automated Software Updates (which Windows switchers understand all too well!) but no automated way to be lead to firmware updates. It's my feeling that if firmware notification were included in SU notifications, or via email, it might reduce the number of phone calls and result in happier computers.
    While I enjoy reading all the Mac news on a daily basis, a lot of users don't and there may be an even greater number who don't know the wheat from the chaff (or even know where to find the wheat!).
    Some firmware updates are critical, some of minor importance, and some (more and more of late, it seems) just a bit cryptic (for instance, 1.01 says "This firmware update is for (MacBook Pro)/iMac (early 2006) computers with Intel processors only. It now runs on localized systems that use languages that read right to left." and then lists the languages supported - which do not include Hebrew or Arabic, two "languages that read right to left".
    The only reason that I brought this up is that there are a number of sites that reported that the firmware update alleviates some of the 'whine' that some MBP users are reporting (and now I am reading of 'hum' issues - forget GarageBand! An hundred MBP's could replace a symphony!). Now is that true or not? Apple doesn't say - some users report yes, some no. And as there are no whine or hum issues on the iMac, I doubt 1.01 would 'solve' any of those problems with that machine (and interesting, too, that the "iMac (early 2006) Firmware Update 1.0.1" isn't in the "Top Downloads" section as is "MacBook Pro (early 2006) Firmware Update 1.0.1": what's up with that? Are there really more MBPs out there than Intel iMacs? Or are MBP owners running Windows in Arabic more than Intel iMac owners? Or just hopeful that the update does, indeed, help with the whine problem.
    I keep getting off topic (sort of)...
    ...my point is that it would be simple to notify, and simpler for (in my opinion), Apple to notify customers of firmware updates.

  • How can I find out the screen size of the users moniter using the Acrobat SDK?

    How can I find out the screen size of the users moniter using the Acrobat SDK? I need to know how much sreen real estate that is available on the users moniter. Is there some call that I can make from the SDK to discover the maximun X and Y coordinates?
    Thanks,
    Gregory

    Currently, I am testing on multiple moniters and it is defaulting to the moniter designated as the #1 moniter. For our purposes, this is acceptable. Once the two documents have loaded, the user can move and re-size at will.
    Gregory

  • How to find out about the SMTP Server

    Hi,
    I have been trying to configure groupware in the portal - in particular I want to enable the sending of emails through the portal. I already have a how-to-guide that that seems to explain the steps quite well. However, it mentions that I need to know the SMTP Server of the email. Can you tell me how to find out about the SMTP Server? Where do I need to look for the name of it?
    Thank you and regards,
    Katharina

    Hi Katharina,
    you need the SMTP server of your company. This means you can't look for it in the portal, but have to ask the responsible person in your company.
    Kind regards,
    dominik

  • How to find out the image size?

    How to find out the image size values(Width and height) in illustrator CS3 using any script. I tried but i got only the document height and width. I need to find out the image BoundingBox value of width and height. Kindly advice me.

    Try this.
    tell application "Adobe Illustrator"
    set heightImage to get height of raster item 1 of current layer of current document
    set widthImage to get width of raster item 1 of current layer of current document
    display dialog (heightImage & " X " & widthImage) as string
    end tell
    JaiMS

  • I am looking to find out about specifications of the components of Hyper-V

    Hi,
    I am looking to find out about specifications of the components of Hyper-V, is someone able to reach out to me? Some features I am looking to find if Hyper-V covers (and the components that would be used) are:
    Automated   live migration
    Workload balancing
    Physical-to-virtual conversion
    Plug-in for SCOM
    Integrated StorageLink
    Distributed Virtual Switch
    Use of OpenStack?
    Thanks,
    Eric

    You can check with OpenStack to determine their support.
    SCOM support of Hyper-V - check wit the SCOM team.
    Automated Live Migration - this could be interpreted multiple ways.  However I suspect you are looking for the SCVMM PRO feature.
    Workload Balancing and StorageLink and Distributed Virtual Switch are feature / product names from companies other than MSFT - so you must elaborate on the use case.
    Not sure what your intent is, but it reads as if there is some feature comparison you are trying to do between apples and oranges.
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

  • How do you find out about new VoD videos

    Quick question for FiOS TV users - how do you (personally) find out about new on-demand videos?
    Do you rely on the Spotlight email, or the trailers playing in the VoD store-front, or mail inserts etc? Keen to hear what everyone thinks works best!
    Thanks,
    Rich

    Here is one suggestion for you.
    http://www22.verizon.com/residential/fiostv/vod/vod.htm
    Joe D
    Verizon Telecom
    Fiber Solution Center
    Notice: Content posted by Verizon employees is meant to be informational and does not supercede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or Plan.Follow us on Twitter™!

  • When will Verizon Cell Tower installed in 2013 on Ridge Road in Town of Broome, Schoharie CountyNY be turned on? Where in the Verizon Co. can I find out about this

    A cell tower was installed in 2013 on Ridge Road in Town of Broome, Schoharie CountyNY. It appears to be ready to operate. When will it be turned on? Where in the Verizon Co. can I find out about this. I now depend on an unreliable and expensive dish-satellite system for internet access and would like to be able to take advantage of my Verizon WiFi cell to connect. Who and how do I contact Verizon to find out? Many thanks.

    Are you sure it isn't turned on? Are you sure it is even a Verizon tower? If it is a Verizon tower, it may not be turned on yet because it has not received approval from your local government. If it is awaiting approval, Verizon has no control about when approval will be granted.

  • How to I find out the photos SIZE in inches. It will give the the resolution

    How to I find out the photos SIZE in inches. It will give the the resolution of the image and the file size.

    In iPhoto, images don't have a size in inches until you use them. Until then it is just the pixel size. If you know the pixel size and resolution you calculate it this way:
    If the image size is 5184 x 3486 (like my Canon T3i, you divide the size in pixels by the resolution in pixels per inch to get the actual length, so for some common resolutions:
    Res Width Height
    --         5184     3486
    300      17.3      22.6  
    220       23.6     15.8
    72          72       48.4
    So, as you can see, iPhoto is probably correct in ignoring file size for most recent digital cameras. There is plenty of resolution for almost any size you want to print.

  • How do I find out about apps for my business

    How do I find out about potential apps that exist but that I don't know of yet

    Hey,
    What I would recommend doing is contacting the local Apple Store in your area. All Apple Retail Stores have specialized business teams that hold free workshops on using the iPad for business and have lots of knowledge about business applications/uses. Give your local store a call and ask for the business team!
    Hope this helps =)
    rizz

  • How do I find out about disk usage ie how much space I have used

    how do I find out about the startup disk, and how much space I have on the computer?

    Try http://www.omnigroup.com/products/omnidisksweeper/
    Alaln

  • Rm ${datafile}; how to force 10g to find out about it?

    Hey;
    I have a small oracle 10g test instance with which I'm hoping to become familiar with backup and recovery - my first topic of study.
    I have a list of backups both copy and backupset. After getting those, I identified the files in the database:
    2 from dba_data_files
    3* order by tablespace_name
    SQL> /
    FILE_NAME FILE_ID STATUS TABLESPACE
    /oracle/oradata/oci1/example01.dbf 5 AVAILABLE EXAMPLE
    /oracle/oradata/oci1/sysaux01.dbf 3 AVAILABLE SYSAUX
    /oracle/oradata/oci1/system01.dbf 1 AVAILABLE SYSTEM
    /oracle/oradata/oci1/undotbs01.dbf 2 AVAILABLE UNDOTBS1
    /oracle/oradata/oci1/users01.dbf 4 AVAILABLE USERS
    then blasted example.dbf;
    $ ls -ld /oracle/oradata/oci1/example01.dbf
    ls: /oracle/oradata/oci1/example01.dbf: No such file or directory
    I was thinking that would start screaming immediately in the alert log... so far, nothing. I then tried a query of the hr schema and that worked. That obviously means the hr schema is in the sga which is curious by itself because I've never queried that table before.
    Finally a report from the v$datafile_header is also showing everything is still there:
    SQL> select file#, status, error, recover, tablespace_name, name
    2 from v$datafile_header;
    FILE# STATUS ERROR REC TABLESPACE NAME
    1 ONLINE NO SYSTEM /oracle/oradata/oci1/system01.dbf
    2 ONLINE NO UNDOTBS1 /oracle/oradata/oci1/undotbs01.dbf
    3 ONLINE NO SYSAUX /oracle/oradata/oci1/sysaux01.dbf
    4 ONLINE NO USERS /oracle/oradata/oci1/users01.dbf
    5 ONLINE NO EXAMPLE /oracle/oradata/oci1/example01.dbf
    I also forced a check point with alter system checkpoint and still nothing in the alert log or v$datafile_header query.
    How long will it be before oracle does the 'holy crap!' thing and/or how can I force it to find out about the missing datafile?
    Thanks for any info..
    Doug O'Leary

    Actually, if, after removing the file from the O/S, you login to the database w/ a new session, this will give you a new server process (assuming you're not running shared server), and that server process would not be able to open that file. If you now do a select and force a full table scan on a table that has extents in the file that you deleted, your process should catch an error.
    -Mark
    Edited by: mbobak on Jul 22, 2009 11:30 AM

  • How to find out about questions

    How to find out about a question I submitt with out looking through everything?

    If your question is .... you submit a question and then just want to see replies to it? Enable email notifications, and you'll get an email when people respond to your post. Each email includes a link you can click on to go immediately to the thread you started.

Maybe you are looking for

  • 2013 iMac 21.5 having issue to airplay with apple tv?

    My iMac is not mirroring through airplay on my tv through Apple TV (I have the latest Apple TV)...anyone with a solution?

  • Connect iphone to Qumi projector

    hi, i need to connect my iphone to Vivitek Qumi projector which cable shuold i use? Thanx

  • MIR7 cannot pick negative transaction

    SAP master, In MIR7, user choose credit memo, and then key-in PO reference in the middle screen, but the negative goods receipt (in po history ME23N) cannot be display and cannot be picked-up; only display positive goods receipt. May I know what's wr

  • XI Performence issue

    Hi, All we have IDOC ->JDBC Scenario we need to send 3,50,000 IDOC Data to JDBC Tabel ,Data(3,50,000) Reached to XI ,From XI to Insert in to Tables It is Taking time. Per minit XI Is Processing 50 Records,It will Take lot of time to process all Recor

  • Configuration Key link with Business Transaction

    Hi Frds, Where can we identify the Business transaction type link with the configuration key. I am looking at code place prospective not by pressing f2 in the UI. Please suggest. Thanks Imran