Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Java search result loading into IFRAME

    I want to have a section in my website where people just have to type a name and it's html page loads (type "test" and "test.html" loads)

    Now I can do this and it loads like a regular link, but I want the results to load into an IFRAME instead. The code is as follows:

    function search(entry) {
    if (entry!=""&&entry.length>3) {
    out = " ";
    temp = "" + entry;

    while (temp.indexOf(out)>-1) {
    pos= temp.indexOf(out);
    temp = "" + (temp.substring(0, pos) +
    temp.substring((pos + out.length), temp.length)); }

    n = temp.toLowerCase();
    filenm = n+".html";
    if(n=="test")
    { location.replace(filenm); }
    else
    { alert("Sorry, "+entry+"'s Profile Not Found");
    document.fm.nm.value=""; }
    }
    else
    { document.fm.nm.value=""; }
    }

    hexColor = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];

    function mOver() {
    for (i = 0; i < 13; i++) {
    setTimeout('document.fm.button.style.background="#'+hexColor[12-i]+'0'+hexColor[12-i]+'0c0";', i * 40);
    }
    }

    function mOut() {
    document.fm.button.value="Search ";
    for (i = 9; i > 0; i--) {
    setTimeout('document.fm.button.style.background="#'+hexColor[i]+hexColor[i]+hexColor[i]+hexColor[i]+hexColor[i]+'0";', i * 40);
    }
    }

    The page where I am experimenting is http://www.5-tigers.net/test/search/

    Type "test" into the search box, and the "test.html" will load, but not into the IFRAME. Live Help can be given if wanted also AIM=Sain Cai

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Looks like it's working to me...did you fix this?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    EDIT:

    Got it to work now. changed the code to this in it's respective spot:

    n = temp.toLowerCase();
    filenm = n+".html";
    if(n=="test"||n=="index")
    {window.frames["cwindow"].location.replace(filenm); }

    Thank everyone for their help (Search function)
    Last edited by Sain Cai; 01-15-2003 at 07:20 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •