javascript > variable reset help!

Discussion in 'HTML' started by CADD, Aug 29, 2006.

  1. CADD

    CADD Guest

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

    Any help would be greatly appreciated.

    CADD
    CADD, Aug 29, 2006
    #1
    1. Advertising

  2. In article <>,
    "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.


    <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
    Nikita the Spider, Aug 29, 2006
    #2
    1. Advertising

  3. 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
    >
    Harlan Messinger, Aug 29, 2006
    #3
  4. 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
    Jonathan N. Little, Aug 29, 2006
    #4
  5. CADD

    CADD Guest

    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="javascript:popup()"><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 <>,
    > "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.

    >
    > <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
    CADD, Aug 29, 2006
    #5
  6. CADD

    CADD Guest

    <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
    > >
    CADD, Aug 29, 2006
    #6
  7. CADD

    CADD Guest

    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
    > > >
    CADD, Aug 29, 2006
    #7
  8. In article <>,
    "CADD" <> wrote:
    > Nikita the Spider wrote:
    > > In article <>,
    > > "CADD" <> 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
    Nikita the Spider, Aug 30, 2006
    #8
  9. CADD wrote:
    <snip>

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


    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=javascript: not valid href protocol&btnG=Google Search
    javascript: not valid href protocol - Google Search

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Aug 30, 2006
    #9
  10. [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="javascript:popup()"><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.
    Harlan Messinger, Aug 30, 2006
    #10
  11. CADD

    CADD Guest

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


    It's fine because AIML is and XML-variant that gets parsed on-the-fly
    and the <person/> is being passed to the javascript as requested. It's
    all done via HTML on the client-side.

    Check it out for yourself if you'd like:

    http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536

    Type: "RSS baseball"

    Then try "RSS donuts"



    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="javascript:popup()"><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.


    It shows up on the page and everything works smooth.

    Exept for the fact the link you just clicked will be the same one,
    unless you clear your internet browser.


    I apologize in posting in the wrong forum, but i thought a java-guy
    might be able to ignore some trivial code and possibly offer a solution


    Harlan Messinger wrote:
    > [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="javascript:popup()"><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.
    CADD, Aug 30, 2006
    #11
  12. CADD

    CADD Guest

    You're right, it does bring up a lot of questions, which I was trying
    to keep all this as simple as possible from the beginning.

    I wouldn't expect anyone here to know much about Artificial
    Intelligence Markup Language [AIML], but it's just another variant of
    XML and all is well on that end of things.

    The beautiful thing about XML is it comes in many forms and integrates
    with everything.

    Yes, the user submits his input by pressing a button in an HTML form -
    you can give it a try here:
    http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536

    It's definitely something with the javascript example, the variable is
    definitely making it through the script, but just not leaving when it's
    the end of the function. It was my first attempt of putting together
    javascript used for anything like that, so i can't say for sure that my
    use of variables was appropriate.

    If someone could ignore the rest of the stuff and help me put together
    a better way of what i posted, I would be extremely grateful.

    Nikita the Spider wrote:
    > In article <>,
    > "CADD" <> wrote:
    > > Nikita the Spider wrote:
    > > > In article <>,
    > > > "CADD" <> 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
    CADD, Aug 30, 2006
    #12
  13. CADD wrote:
    >> 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.

    >
    > It's fine because AIML is and XML-variant that gets parsed on-the-fly
    > and the <person/> is being passed to the javascript as requested. It's
    > all done via HTML on the client-side.
    >
    > Check it out for yourself if you'd like:
    >
    > http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536
    >
    > Type: "RSS baseball"
    >
    > Then try "RSS donuts"
    >
    > 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="javascript:popup()"><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.

    >
    > It shows up on the page and everything works smooth.
    >
    > Exept for the fact the link you just clicked will be the same one,
    > unless you clear your internet browser.
    >
    > I apologize in posting in the wrong forum, but i thought a java-guy
    > might be able to ignore some trivial code and possibly offer a solution


    The "trivial code" involves a technology I never heard of and probably
    has something to do with the problem. If I or anyone in a similar
    position don't know the technology and therefore don't know the correct
    way to use it, how are we supposed to tell you whether what you've done
    is right or wrong?
    Harlan Messinger, Aug 30, 2006
    #13
  14. CADD

    CADD Guest

    only asking for help with the javascript, everything else seems to be
    smooth sailing.

    the var name takes input and doesn't get ride of it.

    how can i get my variable to reset every time it is passed a variable?


    Harlan Messinger wrote:
    > CADD wrote:
    > >> 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.

    > >
    > > It's fine because AIML is and XML-variant that gets parsed on-the-fly
    > > and the <person/> is being passed to the javascript as requested. It's
    > > all done via HTML on the client-side.
    > >
    > > Check it out for yourself if you'd like:
    > >
    > > http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536
    > >
    > > Type: "RSS baseball"
    > >
    > > Then try "RSS donuts"
    > >
    > > 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="javascript:popup()"><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.

    > >
    > > It shows up on the page and everything works smooth.
    > >
    > > Exept for the fact the link you just clicked will be the same one,
    > > unless you clear your internet browser.
    > >
    > > I apologize in posting in the wrong forum, but i thought a java-guy
    > > might be able to ignore some trivial code and possibly offer a solution

    >
    > The "trivial code" involves a technology I never heard of and probably
    > has something to do with the problem. If I or anyone in a similar
    > position don't know the technology and therefore don't know the correct
    > way to use it, how are we supposed to tell you whether what you've done
    > is right or wrong?
    CADD, Aug 30, 2006
    #14
  15. CADD

    CADD Guest

    try it and tell me what you think.

    http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536

    you can also talk to it about whatever else you want - it has an
    knowledgebase of over 47,000 topics.


    Harlan Messinger wrote:
    > CADD wrote:
    > >> 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.

    > >
    > > It's fine because AIML is and XML-variant that gets parsed on-the-fly
    > > and the <person/> is being passed to the javascript as requested. It's
    > > all done via HTML on the client-side.
    > >
    > > Check it out for yourself if you'd like:
    > >
    > > http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536
    > >
    > > Type: "RSS baseball"
    > >
    > > Then try "RSS donuts"
    > >
    > > 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="javascript:popup()"><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.

    > >
    > > It shows up on the page and everything works smooth.
    > >
    > > Exept for the fact the link you just clicked will be the same one,
    > > unless you clear your internet browser.
    > >
    > > I apologize in posting in the wrong forum, but i thought a java-guy
    > > might be able to ignore some trivial code and possibly offer a solution

    >
    > The "trivial code" involves a technology I never heard of and probably
    > has something to do with the problem. If I or anyone in a similar
    > position don't know the technology and therefore don't know the correct
    > way to use it, how are we supposed to tell you whether what you've done
    > is right or wrong?
    CADD, Aug 30, 2006
    #15
  16. Jonathan N. Little, Aug 30, 2006
    #16
  17. CADD

    CADD Guest

    i'm open for suggestions - what's a better way to do it?


    Jonathan N. Little wrote:
    > CADD wrote:
    > > try it and tell me what you think.
    > >
    > > http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536
    > >

    >
    > But the example you show above employs a legitimated form with a submit
    > button, yours is using a quirky kludge of a link with the
    > pseudo-protocol "javascript:" which I have already pointed out was a
    > very bad idea.
    >
    >
    > --
    > Take care,
    >
    > Jonathan
    > -------------------
    > LITTLE WORKS STUDIO
    > http://www.LittleWorksStudio.com
    CADD, Aug 31, 2006
    #17
  18. CADD wrote:
    > i'm open for suggestions - what's a better way to do it?
    >
    >
    > Jonathan N. Little wrote:
    >> CADD wrote:
    >>> try it and tell me what you think.
    >>>
    >>> http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536
    >>>

    >> But the example you show above employs a legitimated form with a submit
    >> button, yours is using a quirky kludge of a link with the
    >> pseudo-protocol "javascript:" which I have already pointed out was a
    >> very bad idea.


    The way they did it in your example, with a true form and a submit button.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Aug 31, 2006
    #18
  19. In article <>,
    "CADD" <> wrote:
    >
    > Yes, the user submits his input by pressing a button in an HTML form -
    > you can give it a try here:
    > http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536
    >
    > It's definitely something with the javascript example, the variable is
    > definitely making it through the script, but just not leaving when it's
    > the end of the function. It was my first attempt of putting together
    > javascript used for anything like that, so i can't say for sure that my
    > use of variables was appropriate.


    Having looked at the example, I'm not sure what the problem is. I go to
    the URL that you gave above, type in "rss baseball", hit enter, and I
    get another screen that looks basically the same but with this added:
    Human: rss baseball
    botCAD: baseball.

    On that page, it looks like the very top of the <script> block (var name
    = " baseball";) was generated by a server-side process based on my
    input. If the server-side process isn't writing the correct value into
    that variable, then this isn't a Javascript problem and it isn't an HTML
    problem, it is a problem with your server side code. Make sense?

    --
    Philip
    http://NikitaTheSpider.com/
    Whole-site HTML validation, link checking and more
    Nikita the Spider, Aug 31, 2006
    #19
  20. CADD

    CADD Guest

    Nikita,

    Thanks again for the reply.

    It makes sense what you're saying, but I do not believe it to be a
    server-side error because the variable is actually assigned. When you
    type baseball, it generates a link that says baseball and when you
    click the link, it takes you to an RSS baseball search on bloglines. if
    you go back and now type "RSS football", the link says football now,
    but when you click it, it still takes you to the RSS baseball search.

    any other thoughts?

    Nikita the Spider wrote:
    > In article <>,
    > "CADD" <> wrote:
    > >
    > > Yes, the user submits his input by pressing a button in an HTML form -
    > > you can give it a try here:
    > > http://www.pandorabots.com/pandora/talk?botid=875d96ffae366536
    > >
    > > It's definitely something with the javascript example, the variable is
    > > definitely making it through the script, but just not leaving when it's
    > > the end of the function. It was my first attempt of putting together
    > > javascript used for anything like that, so i can't say for sure that my
    > > use of variables was appropriate.

    >
    > Having looked at the example, I'm not sure what the problem is. I go to
    > the URL that you gave above, type in "rss baseball", hit enter, and I
    > get another screen that looks basically the same but with this added:
    > Human: rss baseball
    > botCAD: baseball.
    >
    > On that page, it looks like the very top of the <script> block (var name
    > = " baseball";) was generated by a server-side process based on my
    > input. If the server-side process isn't writing the correct value into
    > that variable, then this isn't a Javascript problem and it isn't an HTML
    > problem, it is a problem with your server side code. Make sense?
    >
    > --
    > Philip
    > http://NikitaTheSpider.com/
    > Whole-site HTML validation, link checking and more
    CADD, Aug 31, 2006
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski
    Replies:
    5
    Views:
    1,462
    Nathan Sokalski
    Oct 3, 2005
  2. mcdeveloper
    Replies:
    1
    Views:
    4,165
    mcdeveloper
    Jun 13, 2006
  3. sck10
    Replies:
    2
    Views:
    409
    sck10
    Sep 4, 2006
  4. marc wyburn

    CSV variable seems to reset

    marc wyburn, Jun 18, 2008, in forum: Python
    Replies:
    1
    Views:
    284
    Tim Golden
    Jun 18, 2008
  5. CADD

    javascript > variable reset help!

    CADD, Aug 29, 2006, in forum: Javascript
    Replies:
    1
    Views:
    99
Loading...

Share This Page