views:

237

answers:

2

Hi,

Im having issues with having to load my javascript, when I visit my website (php) for the first time(cookies cleared) and I click on a link (which calls a javascript method), it does not work , however if I reload the page and then click on the link, it works(the link does not refresh the page but calls another php page and makes changes on the site)... I am using jquery 1.3.2, if that helps

Does anyone have a solution for this?

btw the link for my site is http://intellectuni.com

and the problem occurs when you vote for a post thats what I was referring to

This is the error I am getting on IE8 Message: Permission denied Line: 20 Char: 25383 Code: 0 for file jquery-1.3.1.min.js

Thanks

+3  A: 

Fire up firebug and see if you're actually getting Javascript sent down the wire. Is there a 404 or 500 whooshing by? Or is code loading correctly? Is your event handler being called? Add a console.log or alert to your handler to test. Is your handler even being attached? Did you put the whole thing in a $(document).ready()? Did you put your script after the jquery.js file, so that jQuery is available when your script attaches event handlers? In general, you know, do that debugging thing we all love so much.

pavpanchekha
No I have not inserted the whole thing under $(document).ready(), but here is the order of my scripts: <script type="text/javascript" src="{$baseurl}/js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="{$baseurl}/js/jquery.form.js"></script> <script type="text/javascript" src="{$baseurl}/js/functions.js"></script>
Tim
Basically the jquery1.3.1.min.js the script works perfectly fine after I reload the page:S and continues to but once i clear the cookies and I go on it for the first time , it wont work, Im not to sure how to debug using fire bug but i will try and see if it reports any errors
Tim
A: 

If your problem is occurring in IE8, you should:

  1. try to use the normal version o jQuery (instead of the minified one)
  2. in IE's advanced options, make sure that disable script debugging isn't checked
  3. fire up IE's developer tools (shortcut for that should be F12) and start script debugging
  4. using the script debugger, try to understand the stack where IE is firing up the error, namely what's jQuery trying to do when the error is triggered

Once you have the thing that jQuery is trying to do when the error is triggered, you should be able to either workaround the issue or find that the bug is jQuery's and submit it to the project maintainers.

Miguel Ventura