?
Solved

Two Javascript interfering with each other

Posted on 2011-09-09
3
Medium Priority
?
234 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

615 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