views:

100

answers:

3

i need jquery to work on a browser locally. how do i know if it is installed and how do i install it ?

my question is specific to being able to run this code:

onmouseover="evt.target.setAttribute('opacity', '0.5'); $('#someDiv').show();"
onmouseout="evt.target.setAttribute('opacity', '1'); $('#someDiv').hide();"
+2  A: 

put this right above your closing body tag:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"
language="javascript" type="text/javascript"></script>

jquery isn't "installed" into a browser. it's a js library referenced from the web page you are viewing.

EDIT: This works if you have internet access. If not, you will have to download that file to your local system and reference the local path.

Jason
no this is not working thank you for your time though
I__
@I__ then you are doing it wrong. like i said, include that line if you have internet access. if not, you must download the jquery file, save it locally, then reference it in the script tag.
Jason
+2  A: 

jQuery isn't installed like a program, it's a file that needs to be included in your source code somehow, the most common practice is to include by adding <script type='text/javascript' language='javascript' src='local/path/to/jquery.js'></script> in the <head> section of your page.

Robert
or put it above your closing `body` tag if you want the page to load more quickly
Jason
+1  A: 

If you are going to include jQuery locally, as per Robert's suggestion, you will first have to download it from here: http://code.jquery.com/jquery-1.4.2.min.js

INTJat
...or include it directly from a CDN, such as google's one.
karim79