Solved

Two Javascript interfering with each other

Posted on 2011-09-09
3
222 Views
Last Modified: 2012-06-21
I have 2 jscripts that work fine independently, but when I put them on the same page, somehow they interfere with each other and one does not work (the other one does). Attached are the 2 javascript files. One called livesearch.js is a script that narrows the search results based off what the user types (this is for the search box). The other script is a drop down menu for choosing the language  (dropdowntabs.js). The livesearch.js script is the one that does not work with the other. On IE you can see the javascript error when you type into the search box at this url:

http://www.perfumeemporium.com/index_test.cfm

You can also just go here to see how the search box is suppose to work when you type something into it, go here and type viva or any 4 or more letter word:

http://www.perfumeemporium.com

I did not write any of these scripts and am not that knowledgeable on jscripts. Thank you for your help in advance.
dropdowntabs.js
livesearch.js
0
Comment
Question by:seeraig
3 Comments
 

Expert Comment

by:G_Teley
ID: 36509419
Just a little hint: Put a semicolon after function call in the onkeypress="liveSearchStart()" part.
That would become:
<input id="livesearch" class="NFText" type="text" tabindex="1" maxlength="64" size="21" onblur="setTimeout('closeResults()',2000);" name="productsearch" onkeypress="liveSearchStart();" value="">


0
 
LVL 19

Accepted Solution

by:
Bardobrave earned 500 total points
ID: 36509440
You haven't closed the <script> tag for dropdowntabs.js, this is why the second file is not working.

0
 

Author Closing Comment

by:seeraig
ID: 36509557
geez, can't believe it was that simple. thanks. While I have you here, there is one other issue with the search results script. I also added a script that shows an image when you mouse over one of the search results. You can see it working here (just type viva and mouseover any result):

http://www.perfumeemporium.com/womens_perfume_index.cfm

But on the homepage, I know there is some problem with the z-index and the search result image going underneath the layer with the 3 large rotating gift set images. Can't figure it out though. You can go to the homepage (www.perfumeemporium.com) and type calvin klein, then scroll down to the last couple results and mouseover the fragrance and you will see the image, but on the results above that the image is going underneath the rotating gift set layer.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question