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

Live Search Plugin

Development and Programming

evarose's avatar
evarose
34 posts
16 years ago
evarose's avatar evarose

Thanks for the help! I wrote some messy code to accept the weblog parameter which did not work so I hardcoded the weblog_id into the plugin as a temp fix – I’ve replaced it with your code and it’s working great.

I had a problem with IE but it was fixed by downloading the most recent version of the plugin (oops!)

Any thoughts on how to get this working in two different search fields would be great – but in the meantime, this is up & working well on my site. Thanks again!

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

Unfortunately, I can’t reproduce the problem. Here’s my setup:

// HTML snippet
<input type="text" name="search_blog" id="search_blog" value="" placeholder="Search Blog..." size="18" maxlength="100" style="width: 140px;" />
<input type="text" name="search_about" id="search_about" value="" placeholder="Search About..." size="18" maxlength="100" style="width: 140px;" />

// Javascript Snippet
$('#search_blog').livesearch('http://localhost/search/livesearch_blog/', {width: 200, center_results: true});
$('#search_about').livesearch('http://localhost/search/livesearch_about/', {width: 200, center_results: true});

Anything else you can tell me about the error?

       
evarose's avatar
evarose
34 posts
16 years ago
evarose's avatar evarose

Is that your actual code in the HTML? Because both inputs have the same id – maybe that’s why yours is working & mine isn’t? (grin)

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

Whoops, fixed 😊 .

       
evarose's avatar
evarose
34 posts
16 years ago
evarose's avatar evarose

And does it work? Or is it broken like mine…

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

It was a mistake I made when I posted, I had it right on the site. Works just fine.

       
evarose's avatar
evarose
34 posts
16 years ago
evarose's avatar evarose

Well, it’s working fine on my site now too. Must have had a typo last time round.

Thanks for all the help!

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

Glad you’ve worked it out.

       
engweb's avatar
engweb
10 posts
16 years ago
engweb's avatar engweb

seems i’m having a problem with this that noone else is having. I’m having a hard time troubleshootin it.

the livesearch works, it displays the “live” results, but the hyperlink for those results looks like this:

http://www.domain.com/index.phpmy_article_shortname

there is no slash between index.php and the rest of the url.

what could be causing this? why is it not getting the correct path, or where do I find this code to fix it?

thanks for any help on this!

Kevin.

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

Hey Kevin,

The culprit is most likely your weblog path setting.

Admin > Weblog Administration > Weblog Management > Edit Preferences > Path Settings

The weblog url and/or the comment url should point to the proper location (you can use the link parameter to tell the plugin which one to use, by default it’s the weblog url).

Make sure they have a trailing slash on them as well.

Let me know if that solves it for you, Pascal

       
engweb's avatar
engweb
10 posts
16 years ago
engweb's avatar engweb

😊 That was in fact the problem! - I didn’t realize I have to check those settings on each weblog! It is working as expected now.

Thanks Pascal!

       
mschoening's avatar
mschoening
71 posts
16 years ago
mschoening's avatar mschoening

Hi, I am having a bit of trouble with the plugin because I’m loading jQuery from the google APIs page (yes, to save bandwith :D) like so:

I load the JS from http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js

Now everything works great in Safari but Firefox won’t let me perform the cross-domain AJAX call and I get this error message:

Security Error: Content at http://mydeejays.com/index.php/list may not load data from http://www.mydomain.com/index.php/search/livesearch/d/?q=d&limit=10×tamp=1231105195050.
Error: uncaught exception: [Exception… “Access to restricted URI denied” code: “1012” nsresult: “0x805303f4 (NS_ERROR_DOM_BAD_URI)” location: “http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js Line: 28”]

I would really like to load jQuery from Google so is there a way around this?

I should probably mention that in order to call the Plugin I use the following:

$('#keywords').livesearch('{site_url}index.php/search/livesearch/', { width: '275', center_results: true });

Thanks, Max

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

I think the problem is not that you’re loading data from Google, but because you’re accessing the site using http://domain.com but trying to load data from http://www.domain.com.

Have you tried forcing all site access to use www?

       
mschoening's avatar
mschoening
71 posts
16 years ago
mschoening's avatar mschoening

Indeed it is not the problem because if I load it from the same domain it still gives me the same error and yes it is the www error. Well although I could force the www I am not a big fan of this. Isn’t there any other workaround?

Thanks so much slapshotw for troubleshooting this so fast!

       
mschoening's avatar
mschoening
71 posts
16 years ago
mschoening's avatar mschoening

Also, how come I have to include the {site_url} in my path to the livesearch and Pascal doesn’t mention it and he infact doesn’t do this on his site?

Thanks, Max

       
1 2 3 4 5

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.