Javascript query.

Discussion in 'HTML' started by John Fitzsimons, Apr 20, 2004.

  1. Hi,

    I have recently been trying to put a book search on my site. I am part
    of the way there with a free script. The results being ;

    http://home.vicnet.net.au/~johnf/xsearch-5.2.htm

    The problem however is that the results are on three lines with a
    blank between each "hit". Very inefficient.

    Could anyone please ;

    (1) Tell me how I could get each of the results to display on one line
    eg. Title Author Price.

    (2) Tell me how to show the results of (1) without a blank line
    between each "hit".

    I presume I can/should change either/both of the files ;

    http://home.vicnet.net.au/~johnf/xsearch-5.2.htm
    http://home.vicnet.net.au/~johnf/db.js

    BUT I don't know how/where they need to be changed. Can anyone
    help me please ? With either task. TIA.

    Regards, John.
    John Fitzsimons, Apr 20, 2004
    #1
    1. Advertising

  2. John Fitzsimons

    Steve Pugh Guest

    John Fitzsimons <> wrote:

    >I have recently been trying to put a book search on my site. I am part
    >of the way there with a free script. The results being ;
    >
    >http://home.vicnet.net.au/~johnf/xsearch-5.2.htm


    A nice blank page for anyone who has JavaScript disabled.

    And the user has to download the complete listing to their browser in
    order to search it, not a huge problem at the moment as you only have
    tens of books, but more problematic when you have thousands. Consider
    a database solution instead.

    >The problem however is that the results are on three lines with a
    >blank between each "hit". Very inefficient.
    >
    >Could anyone please ;
    >
    >(1) Tell me how I could get each of the results to display on one line
    >eg. Title Author Price.
    >
    >(2) Tell me how to show the results of (1) without a blank line
    >between each "hit".
    >
    >I presume I can/should change either/both of the files ;
    >
    >http://home.vicnet.net.au/~johnf/xsearch-5.2.htm
    >http://home.vicnet.net.au/~johnf/db.js


    Nope, neither of them

    http://home.vicnet.net.au/~johnf/xsearch-5.2.js

    Find the line that reads
    document.write("<span class='xtitle'>"+records[rc].link+"</span><br>")
    and delete the <br>

    Then find the line that reads
    document.write("<table border=0 width=500><tr><td><span
    class='xresult'>"+records[rc].description+"</span></td></tr></table><span
    class='xlocation'>"+tmp+"</span><br><br>")
    and delete all the table elements and the last <br>, so you end up
    with
    document.write("<span
    class='xresult'>"+records[rc].description+"</span><span
    class='xlocation'>"+tmp+"</span><br>")

    You may need to add some spaces between the spans to keep the various
    bits of information from running into each other.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Apr 20, 2004
    #2
    1. Advertising

  3. On Tue, 20 Apr 2004 14:34:32 +0100, Steve Pugh <> wrote:

    >John Fitzsimons <> wrote:


    Hi Steve,

    >>I have recently been trying to put a book search on my site. I am part
    >>of the way there with a free script. The results being ;


    >>http://home.vicnet.net.au/~johnf/xsearch-5.2.htm


    >A nice blank page for anyone who has JavaScript disabled.


    Okay, but better JavaScript than nothing. :)

    >And the user has to download the complete listing to their browser in
    >order to search it,


    Interesting. I didn't know that.

    >not a huge problem at the moment as you only have
    >tens of books, but more problematic when you have thousands. Consider
    >a database solution instead.


    Would love a database solution but don't know how to code one and my
    web site doesn't allow server side scripting. I might be able to find
    a site that does allow it though. What would be your recommendations
    for such a database ? Are there any programs/tutorials/examples that
    you/anyone else here could point me to please ?

    >>The problem however is that the results are on three lines with a
    >>blank between each "hit". Very inefficient.


    < snip >

    >http://home.vicnet.net.au/~johnf/xsearch-5.2.js


    S/B

    >document.write("<span
    >class='xresult'>"+records[rc].description+"</span><span
    >class='xlocation'>"+tmp+"</span><br>")


    < snip >

    >You may need to add some spaces between the spans to keep the various
    >bits of information from running into each other.


    Well, you fixed both of my queries. Excellent work. Many thanks. :)

    I wasn't however able to get blank spaces between the first two
    fields. When I try to put "padding" in the underline extends where
    there are no characters. :-(

    There are also a few other very minor points that someone may know
    how to fix.

    (1) I changed the display to show 50 items. That is fine and the
    "next" button works okay BUT the number of pages is incorrect.

    For example, a hundred results should show page 1 and 2 at the
    bottom. I get instead ;

    previous page 1 2 3 4 5 6 7 8 9 10 11 Next
    page

    (2) I am happy to have XSEARCH5.2 as a link in appreciation at the
    bottom of the page but would like to change it at the top. For some
    odd reason I cannot find where/which file has the "XSEARCH5.2"
    word. So cannot change it. Can anyone explain where it is please and
    if necessary how to change it if it isn't simply a text replace.

    All input/help appreciated.

    Regards, John.
    John Fitzsimons, Apr 21, 2004
    #3
    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. Learner
    Replies:
    1
    Views:
    973
    Marina Levit [MVP]
    Jan 30, 2006
  2. Anonymous
    Replies:
    0
    Views:
    1,439
    Anonymous
    Oct 13, 2005
  3. David Gordon

    xpath query query

    David Gordon, May 18, 2005, in forum: XML
    Replies:
    2
    Views:
    775
    David Gordon
    May 18, 2005
  4. Eric Nelson
    Replies:
    5
    Views:
    1,503
    Alexey Smirnov
    Feb 4, 2009
  5. Jon F.

    CAML Query: Multiple Query Fields Issue

    Jon F., May 12, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    741
    Jon F.
    May 12, 2004
Loading...

Share This Page