We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LiveSearch

Development and Programming

Vik's avatar
Vik
209 posts
21 years ago
Vik's avatar Vik
you might want to modify ./index.php … to /index.php ….

Where is that text located? I tried it on this:

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

…in LiveSearch.js, but that produced URL not found errors. I don’t yet see it in the LiveSearch template, or in the LiveSearch form code that gets added to the web page.

Thanks in advance for the info!

       
Paul Burdick's avatar
Paul Burdick
480 posts
21 years ago
Paul Burdick's avatar Paul Burdick

That is the correct place. Is the index.php page at the root of your domain? For example: www.yoursite.com/index.php.

       
Vik's avatar
Vik
209 posts
21 years ago
Vik's avatar Vik

I had it in my /exp directory. I just moved it to my httpdocs file, and changed
“./index.php/livesearch/” to “/index.php/livesearch/”. But, I’m getting URL not found errors. I know this is something really easy. What am I missing? Thanks in advance!

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
21 years ago
Lisa Wess's avatar Lisa Wess

paul, if you get a chance - he implemented keyboard navigation

http://blog.bitflux.ch/p1736.html

and I redownloaded the js and added the bit to the body as per the wiki instructions - but it’s not doing itl. Are you able to get that part to work at all on your dev blog? I think that I must be doing something wrong.

Thanks =)

       
Paul Burdick's avatar
Paul Burdick
480 posts
21 years ago
Paul Burdick's avatar Paul Burdick

You had what in your /exp directory. the index.php file or the javascript file? You have to make the link work according to the page loading the javascript.

I have been interested into looking into keyboard navigation since Gmail started up and used it. His idea is worth a look but not tonight.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
21 years ago
Lisa Wess's avatar Lisa Wess

grins whenever you have the time, paul, it’s a nice thing but not major. I’m thrilled that you took the time just to make the basic thing work.

Thank you, sir. =)

       
Vik's avatar
Vik
209 posts
21 years ago
Vik's avatar Vik

I had the LiveSearch.js file in the exp directory. I’ve now moved it back to the exp directory, to be in the same folder with index.php, as you indicated.

As described in this thread, the LiveSearch.js file now has been edited to:

> liveSearchReq.open(“GET”, “./index.php/livesearch/” + document.forms.searchform.s.value+”/”);

It appears that all that’s left is the link.

> You have to make the link work according to the page loading the javascript.

Okay, I now have LiveSearch working again for my site’s home page. What should the link be for, e.g., the monthly_archives template?

> http://www.luxeword.com/exp/index.php/weblog/monthly_archives/2004/04/

I’ve tried it like this:

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

and like this:

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

       
Chris Curtis's avatar
Chris Curtis
17 posts
21 years ago
Chris Curtis's avatar Chris Curtis

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

       
Vik's avatar
Vik
209 posts
21 years ago
Vik's avatar Vik

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.

       
PXLated's avatar
PXLated
1,800 posts
21 years ago
PXLated's avatar PXLated

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 😊

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
21 years ago
Lisa Wess's avatar Lisa Wess

This is a plugin request, though… 😉

       
PXLated's avatar
PXLated
1,800 posts
21 years ago
PXLated's avatar PXLated

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 😊

       
Paul Burdick's avatar
Paul Burdick
480 posts
21 years ago
Paul Burdick's avatar Paul Burdick

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.

       
PXLated's avatar
PXLated
1,800 posts
21 years ago
PXLated's avatar PXLated

😊

       
PXLated's avatar
PXLated
1,800 posts
21 years ago
PXLated's avatar PXLated

Ooops…I meant… 😊 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.

       
1 2 3 4 5 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.