pathJS won't work - doesn't load any content - javascript

I tried to implement pathJS into my project, which is already using zurb.Foundation in combination with jQuery.
My JS is quite clean so far, so there shouldn't be any problems at all.
I just created a fiddle to ease up testing http://jsfiddle.net/Vyuz5/
The Chrome Dev Tools point out this error: Uncaught TypeError: Cannot call method 'apply' of undefined
When I load the file via localhost, I just get the alert 'map' (immediately, without clicking anything).
As the documentation is quite minimal, I don't have any idea where I have these problems..

Alright.. fixed it.
I just had to remove the handler after the call:
Path.map("#/link1").to(function(){
doNothing("it did it!");
$('#loading').html('bazinga');
}).enter(doNothing('map_link1'));
to
Path.map("#/link1").to(function(){
doNothing("it did it!");
$('#loading').html('bazinga');
});
That's it.. whyever :)
Revision 1

Related

Uncaught type Error by jQuery Flexslider

i have a problem on the following site: http://www.turtle-esport.de/v3
In the Console is this error:
Uncaught TypeError: $(...).flexslider is not a function
I hope anyone can help me to find the failure.
This is really the answer! Looks like the version you are loading for FlexSlider is corrupt. Please try to get a fresh copy from GitHub's repository. Coz that works!
Preview:
This is mainly because of 2 reasons:
1. You are adding more than 1 jquery library, remove older jquery and only 1 latest jquery
2. Place allother scripts below jquery
Currently your jquery is conflicting with one another and so you are seeing error in your console

Uncaught TypeError: undefined is not a function?

I am getting this error in Chrome's Developer Tools:
Uncaught TypeError: undefined is not a function
This error is referencing this line of my main.js file. These two lines are both causing this error to happen:
jQuery("#signupfrm").fadeToggle('fast',function(){
jQuery("#loginfrm").fadeToggle('fast',function(){
I am getting this error when working on the website on my local computer, but it's from a theme I purchased that has a demo available online.
Here's a working copy of this same template:
https://www.whmcsdesigns.com/demo/cart.php?a=add&pid=1&systpl=flex
Just select "I will use my existing domain and update my nameservers" and enter any domain name. You'll be taken to a page where personal info can be entered. You will see that you have the option to select between "New Customer" and "Existing Customer". It works at the link above.
However, on my local server it's not letting me switch between new and existing. It just gives the error show above and is referencing those lines with signupfrm and loginfrm.
I'm guessing since it's working on the link aboving, those functions must be defined. Can anyone else find where those are being defined at?
Things that I suspect to be the problem:
jQuery hasn't been loaded correctly so the jQuery function can't be performed. It might not have been loading at all or it might be called $, but if other calls to jQuery work it should be OK.
fadeToggle is a part of jQuery so I expect that to work if jQuery is loaded
jQuery("#signupfrm").fadeToggle('fast',function(){
sometimes if you load dynamically and you test on C:\ or whatever local path things don't work the same, especially AJAX calls. Set up a local webserver to work on always, just using localhost on a simple Apache is a good start

Lightbox error when transferring codes to server

I am implementing a JQuery Lightbox on a website I'm working on. The same set of codes work very well in localhost, but when I transfer the codes to my server, I get this error concerning the lightbox. Uncaught TypeError: Object function Object() { [native code] } has no method 'extend' . I have no idea what error this signifies.
Also I only have jQuery lib on the page.
here is the page I'm working on mypage
Please help me.
Update
I added <script>jQuery.noConflict();});</script> within <head></head> of html..in between jquery lib and lightbox script link. But still not working.
Thanks
Working well, you may try to reupload lightbox.css to fix alignment issue.
A lot of times that error happens when a dependent script is missing. It can also happen if you are using multiple libraries besides jQuery.

Attempting to debug JavaScript and jQuery - where to go with this...?

Our company site has a JavaScript problem that I'm desperately trying to solve, but really struggling with. My JS skills are good enough to build a site with things like jQuery, but I am not that proficient in debugging - so really appreciate any help.
Seemingly randomly, all JS components (e.g. a jQuery Datepicker) on the page stop working. When force-reloading the page with the error console open, these errors happen about 60% of the time - there doesn't seem to be any pattern to it. The only way to fix the site once this happens is by clearing the cache and reloading.
The Console outputs the following:
Uncaught TypeError: Object #<Object> has no method 'each'
Uncaught TypeError: Object #<Object> has no method 'not'
Uncaught TypeError: Object #<Object> has no method 'each'
However: that's just one example. Other times I will get completely different errors. E.g. a few minutes after submitting this question, I tried again, and got this:
Uncaught TypeError: Cannot call method 'apply' of undefined
Which again was thrown from jquery.min.js - pretty-printed, line 1453 (third line down):
if (g.call(k) === "[object Array]")
if (!u)
e.push.apply(e, k);
I set Chrome to break on all unhandled exceptions, and this was another exception it caught - on line 3 of the minified jQuery library. Shown below is the pretty-printed version:
try {
b.call(c.documentElement, "[test!='']:sizzle")
} catch (f) {
e = !0
}
The actual erroring line begins b.call[...]. This works out to line 1904 of jquery.min.js.
I am using the latest jQuery
This only started happening recently - after changing nothing!
The errors happen seemingly randomly
Usually (but sometimes), no errors are thrown from my scripts - e.g. script.js - usually they are thrown from a minified library. It varies each time.
This seems to happen in all browsers, but more often in Chrome than Firefox
Any ideas where to begin? Unfortunately this is an internal corporate website so providing access is tricky, as we deal with sensitive data throughout the site.
Thank you for your help!
Seems to me that your page is quite big and the browser tries to execute the js code before the DOM loads completely... probably because you're using in-line javascript code..
That could explain the random errors and the fact that you have errors when you force the reload.
I'd suggest you to put your JS code inside a dom ready event so the js code could be executed without problems..
Hope this helps :)

Can't get jstree working - "Uncaught TypeError: Object #<Object> has no method 'delegate'"

I'm trying to get the jstree plugin working, following the "Predefined HTML" example on this page: http://luban.danse.us/jazzclub/javascripts/jquery/jsTree/reference/_examples/1_datasources.html
To avoid any conflict with anything else that might be happening, i've tried to get it working in the simplest possible page, in my public dropbox folder: http://dl.dropbox.com/u/846812/jstree_example/jstree_example.html
The only js i've included in my page is jquery and the main jstree file, jsTree/jquery.jstree.js. (The documentation is a bit shaky about what exactly i need to include, but maybe this is the problem). The rest of the files i downloaded are next to jquery.jstree.js, in the jsTree folder.
I've also got my predefined html, a nested list in a div with id="folder_tree".
When the javascript runs, i get an error Uncaught TypeError: Object #<Object> has no method 'delegate', from line 3629 of the jquery.jstree.js file - hopefully you'll see this error too.
Can anyone have a look at the page (the dropbox link above) and see what i'm doing wrong? thanks, max
(note that the file links in that page don't work - they don't need to in order for jstree to work)
jQuery delegate is since version 1.4.2
You are using a older version of jQuery

Categories