3 of 6
3
LiveSearch
Posted: 24 July 2004 08:28 AM   [ Ignore ]   [ # 37 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

Try using /exp/index.php/livesearch/ instead of ./index.php/livesearch/.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 24 July 2004 09:03 AM   [ Ignore ]   [ # 38 ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

With the help of everyone on this thread, I got it working!

Here’s how I have the line in the LiveSearch.js file:

liveSearchReq.open("GET", "/exp/index.php/livesearch/" + document.forms.searchform.s.value+"/");


I tried that and it worked on my home page, but not on, for example, my monthly_archives page. But it gave me the clue. I got it working on the archive pages by changing the Script Type call to:

<script type="text/javascript" src="/exp/livesearch.js"><script>


This is such a cool feature. Thanks to everyone here for your help on this.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 24 July 2004 03:04 PM   [ Ignore ]   [ # 39 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

An aside…
On a couple of sites I manage, 20-25% of the visitors have Javascript disabled (probably a Windows security or popup ad thing). So, I would prefer that any feature that “requires” Javascript be a plugin or optional. I never use Javascript for something that is critical to using my sites grin

Profile
 
 
Posted: 24 July 2004 03:34 PM   [ Ignore ]   [ # 40 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32895
Joined  05-14-2004

This is a plugin request, though… wink

 Signature 
Profile
MSG
 
 
Posted: 24 July 2004 03:53 PM   [ Ignore ]   [ # 41 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

LisaJill…Ya, I know…But Paul was getting so excited about all the possibilities…widgets, etc…I thought I would voice that it should only be a plugin so optional grin

Profile
 
 
Posted: 24 July 2004 09:48 PM   [ Ignore ]   [ # 42 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Well, if this is used on a form, and the form still submits, then anyone with JavaScript disabled will just not have the search appear while typing.  Simple as that.  Any site administrator should judge for themselves what they wish to add to their site considering their needs and the limits of their users.

And as LisaJill mentioned this is a plugin request, and we have never made plugins required.

 Signature 
Profile
 
 
Posted: 25 July 2004 04:45 AM   [ Ignore ]   [ # 43 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

grin

Profile
 
 
Posted: 25 July 2004 05:33 AM   [ Ignore ]   [ # 44 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

Ooops…I meant…
grin If it degrades gracefully, that’s a good thing.

>> Any site administrator should judge for themselves what they wish to add to their site considering their needs and the limits of their users. <<
I agree 100%. I have found however, that many aren’t aware of what percentage of their visitors disable Javascript. It’s not a spec that’s readily available in normal server logs (that I’m aware of). It’s more common on Windows since IE doesn’t have popup blocking.

Profile
 
 
Posted: 21 August 2004 07:02 PM   [ Ignore ]   [ # 45 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

Has a plug-in been created for this?

Profile
 
 
Posted: 21 August 2004 07:07 PM   [ Ignore ]   [ # 46 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32895
Joined  05-14-2004

No, but the above code works brilliantly, and is not difficult to implement.

 Signature 
Profile
MSG
 
 
Posted: 23 August 2004 07:38 AM   [ Ignore ]   [ # 47 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

LisaJill—”...and is not difficult to implement”

There is always an exception…I am getting a “error on page” message at the bottom of the browser as soon as I type anything into the Livesearch box.

Notes: 1) I use welcome.php, not index.php
2) I have the livesearch.js in the same directory as the welcome.php file
3) I changed the livesearch.js file to:
liveSearchReq.open(“GET”, “./welcome.php/KB/livesearch?s=” + document.forms.searchform.s.value);
4) I have also unsuccessfully tried “/welcome.php/KB/livesearch?s=”

Thanks.

_______________________start Livesearch box template
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” />
<title>Untitled Document</title>

<script type=“text/javascript” src=“livesearch.js”></script>

</head>
<body>

<h4>Blog LiveSearch:</h4>
<form onsubmit=“return liveSearchSubmit()” name=“searchform” method=“get”
action=”/welcome.php”>

<input type=“text” id=“livesearch” name=“s” size=“15” autocomplete=“off”
onkeypress=“liveSearchStart()” />

</form>

<div id=“LSResult” style=“display: none;”><div id=“LSShadow”></div></div>

</body>
</html>

_______________________end Livesearch box template

Profile
 
 
Posted: 23 August 2004 10:04 AM   [ Ignore ]   [ # 48 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Lisa is off moving today, so how about I help?  Do you have a URL to look at?

 Signature 
Profile
 
 
Posted: 23 August 2004 07:46 PM   [ Ignore ]   [ # 49 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32895
Joined  05-14-2004

Lisa has finished moving but is about to collapse in exhaustion for at least ... 40 hours?  Did you get this fixed? =) 

 Signature 
Profile
MSG
 
 
Posted: 24 August 2004 10:06 AM   [ Ignore ]   [ # 50 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

LisaJill - no, this isn’t fixed yet.

I sent Paul the url page with the search box and he replied:
“The only thing I can see that you are missing is
onload=“liveSearchInit()” in your body tag.  The paths look good and
correct, and my browser says it loaded the javascript.”

Now I am confused—
1) do I need the {exp:search:simple_form weblog=“news”} tag in my template?
2) If not, where is the “tag” that Paul is referring to?

Thanks for the follow-up.

Profile
 
 
Posted: 24 August 2004 10:08 AM   [ Ignore ]   [ # 51 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

I sent you back an email about this evan.  The <body> tag is in your HTML.

 Signature 
Profile
 
 
Posted: 24 August 2004 10:18 AM   [ Ignore ]   [ # 52 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

Paul,

I added the onload=“liveSearchInit()”
1) below <body> - it displayed “live.SearchInit()” on the page and the “error on page” still appeared when I entered text into the search box
2) above </body> - ditto
3) after <body> and <form… - ditto

Thanks for your help

Profile
 
 
Posted: 24 August 2004 10:25 AM   [ Ignore ]   [ # 53 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

It should look like:

<body onload="liveSearchInit()">

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 24 August 2004 10:30 AM   [ Ignore ]   [ # 54 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Yes, like Chris has it, in the <body> tag.

 Signature 
Profile
 
 
   
3 of 6
3
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64982 Total Logged-in Users: 32
Total Topics: 82024 Total Anonymous Users: 23
Total Replies: 440857 Total Guests: 183
Total Posts: 522881    
Members ( View Memberlist )
Newest Members:  ariepChris Bandytony leodennisbaldwinhazlett_davidkpspokeli9htcluizmbentsitj