You are here: Re: javascript > variable reset help! « HTML « IT news, forums, messages
Re: javascript > variable reset help!

Posted by CADD on 08/29/06 22:41

the only variable that changes is [var name = "<person/>";]

<person/> is the input from user

so after </category>, that script is terminated.

the script does not run again unless the user enters the "keyword"
again.

when the user runs it again, then the new <person/> should be passed
through the javascript.

at the moment, <a href="javascript:Popup()"><person/></a> says the
correct title for the URL, but when you click it, it takes you to the
last "keyword"

CADD wrote:
> <person/> is input from the user, so it would need to reset every time
> the user typed in a new phrase.
>
> that part works fine, but the variable retains that value and i would
> like it to terminate the input once the link is returned.
>
> the functionality of the script works flawlessly, just the variable
> doesn't reset for new input unless you clear your browser settings.
>
> var name = "<person/>" needs to reset every time i run the code,
> without me having to clear my settings.
>
> Harlan Messinger wrote:
> > CADD wrote:
> > > I've used http://www.bloglines.com to add RSS feeds to my sites there
> > > and setup javascript in my website to search bloglines for the input
> > > term.
> > >
> > > The code below works perfect, but I have 1 minor issue, hopefully
> > > someone more family with javascript can help me out with.
> > >
> > > 1) the variables do not reset, so any future searches return the same
> > > previous returned link, unless i clear settings/cookies.
> >
> > When do you expect them to "reset", and why? There isn't anything here
> > to reset. You're declaring a bunch of variables, and defining them
> > explicitly with hard-coded values in the declaration.
> >
> > The <person/> thing is bizarre. What's that supposed to be?
> >
> > >
> > > {CODE}
> > >
> > > <script language="JavaScript">
> > > var name = "<person/>";
> > > <![CDATA[
> > > function Popup(){
> > > var rssURL = "http://www.bloglines.com/search?q=";
> > > var winWidth=800;
> > > var winHeight=600;
> > > var winScrollbars="yes";
> > > var winToolbar="yes";
> > > var winSizeable="yes";
> > > var winLocation="yes";
> > > var winDirectories="yes";
> > > var winStatus="yes";
> > > var winMenubar="yes";
> > > var winCopyHistory="yes";
> > > newWin=window.open(rssURL+name,"",
> > > "copyhistory="+winCopyHistory+
> > > ",menubar="+winMenubar+
> > > ",status="+winStatus+
> > > ",directories="+winDirectories+
> > > ",location="+winLocation+
> > > ",resizable="+winSizeable+
> > > ",toolbar="+winToolbar+
> > > ",scrollbars="+winScrollbars+
> > > ",height="+winHeight+
> > > ",width="+winWidth);
> > > }
> > > ]]>
> > > </script>
> > > <a href="javascript:Popup()"><person/></a>
> > > {END CODE}
> > >
> > > Any help would be greatly appreciated.
> > >
> > > CADD
> > >

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация