Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Javascript Question

  • 28-07-2005 9:02am
    #1
    Registered Users, Registered Users 2 Posts: 3,012 ✭✭✭


    Hey,

    I'm working on a site that has very badly made search tool on it.

    Basically, to limit hits, the tool currently only responds to a set list of acceptable inputs, so if you type in "th", you get nothing, but "the" will work fine for about 5 of the 20 items with "the in the name....
    The code for this is huge, cause there's an acceptable input for every item, and there's hundreds of items...

    The data involved is in an array, in a seperate file, and I plan on saving the index for each hit into a new array.

    Question is though, how can I use Javascript to pass this results array to a new page?


Comments

  • Moderators, Politics Moderators Posts: 41,240 Mod ✭✭✭✭Seth Brundle


    Are you using server or client side JavaScript?
    What about making a querystring?


  • Registered Users, Registered Users 2 Posts: 3,012 ✭✭✭BizzyC


    I'm an absolute noob when it comes to JavaScript.
    Never went near it before I had to start working on this site, I've been piecing it togethor from the code that was already there, and my knowledge of Java.

    I know how I can implement the tool in Javascript, if I could just pass the list of indexes I need from page to page. I'll take any suggestions on how to do this, it doesn't have to be in an array.

    The Javascript is client side in this case.


  • Registered Users, Registered Users 2 Posts: 3,012 ✭✭✭BizzyC


    Is it possible to set a variable onto the session using only javascript and no other language?


  • Registered Users, Registered Users 2 Posts: 2,170 ✭✭✭Serbian


    BizzyC wrote:
    Is it possible to set a variable onto the session using only javascript and no other language?

    Sounds like a bit of a nightmare site at the moment. I personally hate dealing with JavaScript too. :(

    Anyway, Session variables rely on cookies, so you could set a cookie with JavaScript. If you don't set an expiry time on the cookie, it will be destroyed when the browser window is closed. For information on how to set cookies with JavaScript, click here.


  • Registered Users, Registered Users 2 Posts: 2,170 ✭✭✭Serbian


    I don't know if the ComboBox would be of any use to you? It is essentially an input box that suggests as you type. You could get it to suggest the search terms and link them to the articles. Link here.


  • Advertisement
Advertisement