Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > javascript > variable reset help!

Reply
Thread Tools

javascript > variable reset help!

 
 
CADD
Guest
Posts: n/a
 
      08-29-2006
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.

{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="javascriptopup()"><person/></a>
{END CODE}

Any help would be greatly appreciated.

CADD

 
Reply With Quote
 
 
 
 
Nikita the Spider
Guest
Posts: n/a
 
      08-29-2006
In article <(E-Mail Removed) .com>,
"CADD" <(E-Mail Removed)> 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.


<snip>

> Any help would be greatly appreciated.


First, I can't make out what you're trying to accomplish based on that
snippet. Where is it called from? What the heck is a <person> tag? etc.
Give us a URL where we can examine the code ourselves.

Second, try asking in comp.lang.javascript.

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
 
Reply With Quote
 
 
 
 
Harlan Messinger
Guest
Posts: n/a
 
      08-29-2006
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="javascriptopup()"><person/></a>
> {END CODE}
>
> Any help would be greatly appreciated.
>
> CADD
>

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      08-29-2006
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?


It certainly isn't a JavaScript variable! Cannot see how this could ever
work!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
CADD
Guest
Posts: n/a
 
      08-29-2006

wow - thank you all for the responses.

OK, I didn't fully explain what is going on.

This is being called through HTML. the input of the person is matched
with AIML "keywords", so to invoke the script, the user would type
something like "RSS baseball" and the <person/> tag is AIML to kickback
the input from the user following the keyword (baseball in this case)

so, the [var name = "baseball"; ] takes the input from the <person/>
and uses that as the value and adds it to the end of the URL
[newWin=window.open(rssURL+name,"", ]

this: <a href="javascriptopup()"><person/></a>

returnes a hyperlinked "baseball" and takes the user to the URL
[http://www.bloglines.com/search?q=baseball]

so, it all works perfectly now, except you have to clear your brower's
cookies to get the next search result, otherwise it just keeps
outputting the link with the previously assigned variables.

i would like the variables to terminate after the link is returned, but
they aren't.

thanks again for all the feedback.


Nikita the Spider wrote:
> In article <(E-Mail Removed) .com>,
> "CADD" <(E-Mail Removed)> 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.

>
> <snip>
>
> > Any help would be greatly appreciated.

>
> First, I can't make out what you're trying to accomplish based on that
> snippet. Where is it called from? What the heck is a <person> tag? etc.
> Give us a URL where we can examine the code ourselves.
>
> Second, try asking in comp.lang.javascript.
>
> --
> Philip
> http://NikitaTheSpider.com/
> Whole-site HTML validation, link checking and more


 
Reply With Quote
 
CADD
Guest
Posts: n/a
 
      08-29-2006
<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="javascriptopup()"><person/></a>
> > {END CODE}
> >
> > Any help would be greatly appreciated.
> >
> > CADD
> >


 
Reply With Quote
 
CADD
Guest
Posts: n/a
 
      08-29-2006
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="javascriptopup()"><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="javascriptopup()"><person/></a>
> > > {END CODE}
> > >
> > > Any help would be greatly appreciated.
> > >
> > > CADD
> > >


 
Reply With Quote
 
Nikita the Spider
Guest
Posts: n/a
 
      08-30-2006
In article <(E-Mail Removed). com>,
"CADD" <(E-Mail Removed)> wrote:
> Nikita the Spider wrote:
> > In article <(E-Mail Removed) .com>,
> > "CADD" <(E-Mail Removed)> wrote:

>
> OK, I didn't fully explain what is going on.
>
> This is being called through HTML. the input of the person is matched
> with AIML "keywords",


What's AIML?

> so to invoke the script, the user would type
> something like "RSS baseball" and the <person/> tag is AIML to kickback
> the input from the user following the keyword (baseball in this case)


Yikes, this brings up more questions than it answers, but at least it
gives us a better idea as to what's happening.

You're skipping something important -- the user types "RSS baseball" and
then what does he do in order to signify, "I'm done typing now, please
act on this input"? CLick a submit button in an HTML form? Click a
button that has a Javascript onclick event? In any case, the problem
might be inside the action of the <person/> tag which I gather is
something that's defined in a another language (not HTML). You might
need to ask on a newsgroup that's specific to that language.

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      08-30-2006
CADD wrote:
<snip>

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


Whatever, one biggie problem is the pseudo-protocol "javascript:" should
not be used in an HREF attribute. The reasons have been listed countless
time in the NG. Research a bit on your own...


http://www.google.com/search?hl=en&q...=Google+Search
javascript: not valid href protocol - Google Search

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      08-30-2006
[top-posting corrected]
CADD wrote:
> 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?
>>

> <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.


How does it work fine, when "<person/>" is just a character string that
doesn't do anything? You must be using some underlying server-side
platform that does something with this, but it isn't HTML and it isn't
Javascript. Besides, you don't even show any form fields for a user to
enter input, so how can it be "input from a user"? All you have is

<a href="javascriptopup()"><person/></a>

which is a link that executes the function Popup()--if the user can find
it, because it won't show up on the page. That, in turn, is because the
only thing between the opening and closing A tags is a <person/> tag
that the browser won't recognize as HTML and will therefore ignore.

> 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.


Every time, name will equal "<person/>". First time, every time. Because
that's what you're setting it to.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
You will not be able to reset the access - can't reset. jc MCAD 0 12-09-2007 08:58 PM
"Variable variable name" or "variable lvalue" mfglinux Python 11 09-12-2007 03:08 AM
javascript > variable reset help! CADD Javascript 1 09-02-2006 08:33 PM
CISCO 7XX / 761 password reset or reset to factory defaults Philipp Flesch Cisco 3 06-18-2006 07:47 PM
Javascript -> Applet: variable reset after method call from javascript?! mcdeveloper Java 1 06-13-2006 08:34 AM



Advertisments