Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-15-2003, 04:54 PM   PM User | #1
Sain Cai
New to the CF scene

 
Join Date: Jan 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Sain Cai is an unknown quantity at this point
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
Sain Cai is offline   Reply With Quote
Old 01-15-2003, 05:36 PM   PM User | #2
beetle
Senior Coder

 
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
beetle has a little shameless behaviour in the past
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”
beetle is offline   Reply With Quote
Old 01-15-2003, 06:06 PM   PM User | #3
Sain Cai
New to the CF scene

 
Join Date: Jan 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Sain Cai is an unknown quantity at this point
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 06:20 PM..
Sain Cai is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 03:41 AM.


Advertisement
Log in to turn off these ads.