Solved

Two Javascript interfering with each other

Posted on 2011-09-09
3
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
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…

738 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