Re: [WebDNA] How to get a screen size

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 103741
interpreted = N
texte = --Apple-Mail-1--579821947 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable this is what I do... use [Hideif [wow]=3D1] [/Hideif] [Hideif [wow]=3D1]
[/Hideif] [Showif [wow]=3D1] [/Showif] Brian On Oct 4, 2009, at 2:00 PM, Lawrence Banahan wrote: > My problem is to set up cookie with information coming from the =20 > client before it start loading the page. > So I shall need to do it from the client side, so Javascript I =20 > suppose, but I thought that I could setup cookie with JS before the =20= > [redirect url] ould hit. > So it is not a Webcatalog problem, but I have no idea how to sort =20 > this out > Lawrence > > > > Le 4 oct. 09 =E0 17:04, Govinda a =E9crit : > >>> Hi, >>> >>> This is a sort of javascript problem, but it get into my feet with =20= >>> webdna. >>> I have a first page that set cookies using webdna and then =20 >>> [redirect url] >>> I wish to get the screen size information in order to selectwhat =20 >>> size should be background image. >>> I'm a nubbie to jscript, but I managed to found how to get the =20 >>> screen size and to set it as a cookie, but I can't set that cookie =20= >>> even when it comes before the [redirect url]. >>> As any one got an idea how I could get this work... >>> Thanks in advance >>> Lawrence >> >> do you mean to say that you can [setcookie] fine, and also =20 >> [redirect] fine, but just not both? >> if so, then - what version of webdna are you using? >> if I remember right, some (older) versions could not [setcookie] =20 >> and [redirect] on the same page. In those cases people sometimes =20 >> used [returnraw] as a workaround to then be able to >> Set-Cookie: >> and >> Location: >> >> -Govinda >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> old archives: http://dev.webdna.us/TalkListArchive/ >> Bug Reporting: = http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288 > --Apple-Mail-1--579821947 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable this is what I do... = use

[Hideif [wow]=3D1]
<script = type=3D"text/javascript">
var screenW =3D 640, screenH =3D = 480;
if (parseInt(navigator.appVersion)>3) = {
 screenW =3D screen.width;
 screenH =3D = screen.height;
}
else if (navigator.appName =3D=3D = "Netscape" 
    && = parseInt(navigator.appVersion)=3D=3D3
   =  && navigator.javaEnabled()
   = ) 
{
 var jToolkit =3D = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize =3D = jToolkit.getScreenSize();
 screenW =3D = jScreenSize.width;
 screenH =3D = jScreenSize.height;
}
var offset =3D new Date(); =  /* global variable */
function = doit()
{
document.myform.Offset.value=3Doffset.getTime= zoneOffset();
document.myform.DisplayH.value=3D+screenH;
document.myform.DisplayW.value=3D+screenW;
}
</s= cript>

<script type=3D"text/javascript" = language=3D"javascript">
function = submitform(){
document.getElementById('myForm').submit();
<= div>}
</script>
[/Hideif]


[Hideif [wow]=3D1]
 <body = onload=3D"doit();submitform()">
 <FORM id=3D"myForm" = NAME=3D"myform" ACTION=3D"https://Secure.eTrader.TV/= user.new.tpl" METHOD=3D"post">
 <INPUT = TYPE=3D"hidden" NAME=3D"Offset" VALUE=3D"">
 <INPUT = TYPE=3D"hidden" NAME=3D"wow" VALUE=3D"1">
 <INPUT = TYPE=3D"hidden" NAME=3D"DisplayH" VALUE=3D"">
 <INPUT= TYPE=3D"hidden" NAME=3D"DisplayW" = VALUE=3D"">
</Form>
[/Hideif]

<= /div>
[Showif [wow]=3D1]
  <body = bgcolor=3Dwhite>
[/Showif]



Brian







=




On Oct 4, 2009, at 2:00 PM, Lawrence Banahan wrote:

My problem is to set up cookie = with information coming from the client before it start loading the = page.
So I shall need to do it from the client side, so Javascript I = suppose, but I thought that I could setup cookie with JS before the = [redirect url] ould hit.
So it is not a Webcatalog problem, = but I have no idea how to sort this = out
Lawrence


<= /span>

Le 4 oct. 09 =E0 = 17:04, Govinda a =E9crit :

Hi,

This is a = sort of javascript problem, but it get into my feet with = webdna.
I have a first page that set = cookies using webdna and then [redirect url]
I wish to get the screen size information in order = to selectwhat size should be background image.
I'm a nubbie to jscript, but I managed to found how = to get the screen size and to set it as a cookie, but I can't set that = cookie even when it comes before the [redirect url].
As any one got an idea how I could get this = work...
Thanks in advance
Lawrence

do you mean = to say that you can [setcookie] fine, and also [redirect] fine, but just = not both?
if so, then - what version of = webdna are you using?
if I remember right, some = (older) versions could not [setcookie] and [redirect] on the same = page.  In those cases = people sometimes used [returnraw] as a workaround to then be able = to
Set-Cookie:
and
Location:

-Govinda
---------------------------------------------------------
This message is sent to you because you are = subscribed to
the mailing list <talk@webdna.us>.
To unsubscribe, E-mail to: <talk-leave@webdna.us>
archives: http://mail.webdna.us/l= ist/talk@webdna.us
=


= --Apple-Mail-1--579821947-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] How to get a screen size (Scott Walters 2009)
  2. Re: [WebDNA] How to get a screen size (Lawrence Banahan 2009)
  3. Re: [WebDNA] How to get a screen size ("scott@ideassoftware.com" 2009)
  4. Re: [WebDNA] How to get a screen size (System Administrator 2009)
  5. Re: [WebDNA] How to get a screen size (Govinda 2009)
  6. Re: [WebDNA] How to get a screen size (Lawrence Banahan 2009)
  7. Re: [WebDNA] How to get a screen size (Govinda 2009)
  8. [WebDNA] How to get a screen size (Lawrence Banahan 2009)
--Apple-Mail-1--579821947 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable this is what I do... use [Hideif [wow]=3D1] [/Hideif] [Hideif [wow]=3D1]
[/Hideif] [Showif [wow]=3D1] [/Showif] Brian On Oct 4, 2009, at 2:00 PM, Lawrence Banahan wrote: > My problem is to set up cookie with information coming from the =20 > client before it start loading the page. > So I shall need to do it from the client side, so Javascript I =20 > suppose, but I thought that I could setup cookie with JS before the =20= > [redirect url] ould hit. > So it is not a Webcatalog problem, but I have no idea how to sort =20 > this out > Lawrence > > > > Le 4 oct. 09 =E0 17:04, Govinda a =E9crit : > >>> Hi, >>> >>> This is a sort of javascript problem, but it get into my feet with =20= >>> webdna. >>> I have a first page that set cookies using webdna and then =20 >>> [redirect url] >>> I wish to get the screen size information in order to selectwhat =20 >>> size should be background image. >>> I'm a nubbie to jscript, but I managed to found how to get the =20 >>> screen size and to set it as a cookie, but I can't set that cookie =20= >>> even when it comes before the [redirect url]. >>> As any one got an idea how I could get this work... >>> Thanks in advance >>> Lawrence >> >> do you mean to say that you can [setcookie] fine, and also =20 >> [redirect] fine, but just not both? >> if so, then - what version of webdna are you using? >> if I remember right, some (older) versions could not [setcookie] =20 >> and [redirect] on the same page. In those cases people sometimes =20 >> used [returnraw] as a workaround to then be able to >> Set-Cookie: >> and >> Location: >> >> -Govinda >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> old archives: http://dev.webdna.us/TalkListArchive/ >> Bug Reporting: = http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288 > --Apple-Mail-1--579821947 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable this is what I do... = use

[Hideif [wow]=3D1]
<script = type=3D"text/javascript">
var screenW =3D 640, screenH =3D = 480;
if (parseInt(navigator.appVersion)>3) = {
 screenW =3D screen.width;
 screenH =3D = screen.height;
}
else if (navigator.appName =3D=3D = "Netscape" 
    && = parseInt(navigator.appVersion)=3D=3D3
   =  && navigator.javaEnabled()
   = ) 
{
 var jToolkit =3D = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize =3D = jToolkit.getScreenSize();
 screenW =3D = jScreenSize.width;
 screenH =3D = jScreenSize.height;
}
var offset =3D new Date(); =  /* global variable */
function = doit()
{
document.myform.Offset.value=3Doffset.getTime= zoneOffset();
document.myform.DisplayH.value=3D+screenH;
document.myform.DisplayW.value=3D+screenW;
}
</s= cript>

<script type=3D"text/javascript" = language=3D"javascript">
function = submitform(){
document.getElementById('myForm').submit();
<= div>}
</script>
[/Hideif]


[Hideif [wow]=3D1]
 <body = onload=3D"doit();submitform()">
 <FORM id=3D"myForm" = NAME=3D"myform" ACTION=3D"https://Secure.eTrader.TV/= user.new.tpl" METHOD=3D"post">
 <INPUT = TYPE=3D"hidden" NAME=3D"Offset" VALUE=3D"">
 <INPUT = TYPE=3D"hidden" NAME=3D"wow" VALUE=3D"1">
 <INPUT = TYPE=3D"hidden" NAME=3D"DisplayH" VALUE=3D"">
 <INPUT= TYPE=3D"hidden" NAME=3D"DisplayW" = VALUE=3D"">
</Form>
[/Hideif]

<= /div>
[Showif [wow]=3D1]
  <body = bgcolor=3Dwhite>
[/Showif]



Brian







=




On Oct 4, 2009, at 2:00 PM, Lawrence Banahan wrote:

My problem is to set up cookie = with information coming from the client before it start loading the = page.
So I shall need to do it from the client side, so Javascript I = suppose, but I thought that I could setup cookie with JS before the = [redirect url] ould hit.
So it is not a Webcatalog problem, = but I have no idea how to sort this = out
Lawrence


<= /span>

Le 4 oct. 09 =E0 = 17:04, Govinda a =E9crit :

Hi,

This is a = sort of javascript problem, but it get into my feet with = webdna.
I have a first page that set = cookies using webdna and then [redirect url]
I wish to get the screen size information in order = to selectwhat size should be background image.
I'm a nubbie to jscript, but I managed to found how = to get the screen size and to set it as a cookie, but I can't set that = cookie even when it comes before the [redirect url].
As any one got an idea how I could get this = work...
Thanks in advance
Lawrence

do you mean = to say that you can [setcookie] fine, and also [redirect] fine, but just = not both?
if so, then - what version of = webdna are you using?
if I remember right, some = (older) versions could not [setcookie] and [redirect] on the same = page.  In those cases = people sometimes used [returnraw] as a workaround to then be able = to
Set-Cookie:
and
Location:

-Govinda
---------------------------------------------------------
This message is sent to you because you are = subscribed to
the mailing list <talk@webdna.us>.
To unsubscribe, E-mail to: <talk-leave@webdna.us>
archives: http://mail.webdna.us/l= ist/talk@webdna.us
=


= --Apple-Mail-1--579821947-- System Administrator

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

MacOS X Server problems (2001) unable to launch acgi in WebCat (1997) WebCat2 - [include] tags (1997) Mapping .tmpl extension on NT (1998) Searching multiple Databases (1997) possible, WebCat2.0 and checkboxes-restated (1997) Error & Problem (1997) [quantity] - spoke too soon (1997) Help ..... with better explanation (2001) Duplicate Cart #'s (1998) Opinion: [input] should be called [output] ... (1997) Pass a form (2003) [WebDNA] Amazon Web Services API (2010) Customizing WebDelivery.html (1998) list cookies and list http headers (1997) [WebDNA] New 7.1.702 version (2012) Sendmail Question (2001) Strange error (2000) upload images and other data (2001) sendmail spaces (1997)