[Javascript] HTTP_GET_VARS on JavaScript.

murugesan murugesan at hotpop.com
Tue Aug 26 06:37:23 CDT 2003


<input type=hidden name=cookie>

functiion submitform()
{
    name=document.forms[0].uname.value;
    now=new Date();
    setCookie("visname",name, now);
}


function setCookie(name, value, expires, path, domain, secure)
 {
  var curCookie = name + "=" + escape(value) +
     ((expires) ? "; expires=" + expires.toGMTString() : "") +
     ((path) ? "; path=" + path : "") +
     ((domain) ? "; domain=" + domain : "") +
     ((secure) ? "; secure" : "");
  document.cookie = curCookie;
 }
function getCookie(name)
 {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
  {
      begin = dc.indexOf(prefix);
      if (begin != 0)
    return null;
    }
  else
      begin += 2;
     var end = document.cookie.indexOf(";", begin);
    if (end == -1)
      end = dc.length;
    return unescape(dc.substring(begin + prefix.length, end));
 }


if(getCookie("uname!= null)
 {
    var cook;
  document.forms[0].visnme.value=getCookie("uname");
    if(document.forms[0].cookie.value=='on')  |
     document.forms[0].cookie.value='off';      |
  else                                                             |
setvalueof cookie
     document.forms[0].cookie.value='on';      |
 }

<input type=checkbox onclick=set value of cookie>

-murugesan
----- Original Message -----
From: "Prabu Subroto" <prabusubroto at yahoo.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Tuesday, August 26, 2003 4:42 PM
Subject: Re: [Javascript] HTTP_GET_VARS on JavaScript.


> Dear my friend, Chris...
>
> I tried to understand your advice but I still loose my
> self.
>
> How can I put the cookies? and How can I load the
> value of the variable in the cookie?
>
> Could you give me a clear syntax as an example of
> putting the cookie in JavaScript or PHP and to read
> the cookie with LoadVars?
>
> Please tell me my friends. I am really stuck.
>
> Thank you very much in advance.
> --- Chris Tifer <christ at saeweb.com> wrote:
> > Yes, it's possible. My method to fix this would be
> > to use Cookies and have
> > the first thing Flash does is check this cookie by
> > using a loadVariables
> > command which simply checks the value of the cookie
> > and outputs something
> > like:
> >
> > blHasCookie=1 (or blHasCookie=0)
> >
> > Then judging by that variable in Flash, you either
> > tell it to play from the
> > opening sequence or the other frame (I recommend
> > using Labels instead of
> > frame numbers. Much better...
> >
> > I'm sure you could us FSCommand to talk with
> > JavaScript and issue a command
> > directly to Flash based off the value of the cookie
> > keeping you from making
> > another call to the server, but loadVariables is
> > easier to me.
> >
> > Does that make sense or did I lose you?
> >
> > Chris Tifer
> >
> >
> >
> > ----- Original Message -----
> > From: "Prabu Subroto" <prabusubroto at yahoo.com>
> > To: "[JavaScript List]" <javascript at LaTech.edu>
> > Sent: Friday, August 22, 2003 9:58 AM
> > Subject: Re: [Javascript] HTTP_GET_VARS on
> > JavaScript.
> >
> >
> > > Dear my friend, Christ....
> > >
> > > I am very new in Flash and Macromedia web-pack.
> > >
> > > I am making a homepage
> > >
> >
> (http://www.i-am-e-system.de/www.lam-ag.de/index.html),
> > > so far this is good enough already for me but my
> > boss
> > > has a difficult command for me. He wants that the
> > > visitors can see and read clearly all of the
> > document
> > > if they click on "Vergrößern" (means : enlarge)
> > > button. For example, the visitors click
> > > "Zeichnungsschein Formular" than they will find a
> > > small document with fore animation and two
> > buttons.
> > > One button is for "Vergrößern" (enlarge) and
> > another
> > > is for "Zurück" (back). In order to make the
> > visitor
> > > is able to read the document, I've made a HTML
> > page
> > > which will be displayed if the visitor click on
> > the
> > > "Vergrößern" (enlarge) button in the same window
> > > (today is still in a new window).
> > > Now the problem is my boss has a difficult command
> > for
> > > me, he wants the visitor has a button on the HTML
> > page
> > > so the visitor can go back to the menu but without
> > > animation (not from the first frame) so I need to
> > tell
> > > the flash player/viewer to play not from the
> > frame-1
> > > (first frame) but directly to frame number 50
> > > (fifty-th frame) if the visitor come from the HTML
> > > Page.
> > > Is it possible? Or may be you have another
> > > alternative(another) solution to make the
> > displayed
> > > document bigger?
> > >
> > > I also want to give "Uploading please wait..."
> > message
> > > to the visitors while they are visiting the first
> > page
> > > (the cover) of my homepage and they are actually
> > still
> > > downloading the parts of my flash program
> > (into.swf).
> > > How to do this one?
> > >
> > > Please tell me my friends...
> > >
> > > Thank you very much in advance.
> > > --- Chris Tifer <christ at saeweb.com> wrote:
> > > > This doesn't involve JavaScript. You're calling
> > a
> > > > Flash file and passing
> > > > that parameter into the file. So when you want
> > to
> > > > reference that value
> > > > inside Flash, you just use:
> > > >
> > > > ===========
> > > > _root.number
> > > > ===========
> > > >
> > > > So if you had a dynamic text field with the name
> > of
> > > > myText, you could update
> > > > it's value (assuming that too is on the root) to
> > > > display that "number" by
> > > > doing:
> > > >
> > > > In Flash MX:
> > > > ===========
> > > > _root.myText.text = _root.number
> > > >
> > > >
> > > > In Older versions, I believe you just:
> > > > ===========
> > > > myText = _root.number
> > > >
> > > >
> > > > Although I wouldn't suggest using number as a
> > > > variable name because it's
> > > > normally reserved.
> > > >
> > > > When you call a .swf directly, there will be no
> > HTML
> > > > rendered, hence, no
> > > > JavaScript rendered.
> > > >
> > > > Chris Tifer
> > > > http://emailajoke.com
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Prabu Subroto" <prabusubroto at yahoo.com>
> > > > To: "JavaScript Milis" <javascript at latech.edu>
> > > > Sent: Friday, August 22, 2003 6:20 AM
> > > > Subject: [Javascript] HTTP_GET_VARS on
> > JavaScript.
> > > >
> > > >
> > > > > Dear my friends...
> > > > >
> > > > > Anybody knows how JavaScript take the value of
> > > > > variable which passed over the URL?
> > > > > For example an HTML page pass this statement :
> > "<A
> > > > > href="intro.swf?number='59'>Go to</A>".
> > > > > And than the destination JavaScript of the
> > flash
> > > > file
> > > > > will take the value of "number" and the flash
> > do
> > > > > "gotoAndStop(50)".
> > > > >
> > > > > In PHP I can do that very easily, I can do
> > simply
> > > > with
> > > > > "HTTP_GET_VARS".
> > > > >
> > > > > Please tell me.
> > > > >
> > > > > Thank you very much, my friends...
> > > > >
> > > > >
> > > > > __________________________________
> > > > > Do you Yahoo!?
> > > > > Yahoo! SiteBuilder - Free, easy-to-use web
> > site
> > > > design software
> > > > > http://sitebuilder.yahoo.com
> > > > >
> > _______________________________________________
> > > > > Javascript mailing list
> > > > > Javascript at LaTech.edu
> > > > >
> > > >
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> > > > >
> > > >
> > > > _______________________________________________
> > > > Javascript mailing list
> > > > Javascript at LaTech.edu
> > > >
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! SiteBuilder - Free, easy-to-use web site
> > design software
> > > http://sitebuilder.yahoo.com
> > > _______________________________________________
> > > Javascript mailing list
> > > Javascript at LaTech.edu
> >
> === message truncated ===
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list