Jquery and Java Script does not work an all pages - javascript

My java script and jquery doesn't work on all of my pages.
It works on the home page http://www.steadfastdesignfirm.com/rgw but not when I go to any other page like http://www.steadfastdesignfirm.com/rgw/#index.php etc.
I have a javascript function that loads content from another page into a div dynamically (the div is #ajax) and only the scripts run on items within that div are not working. For example, you'll see the text resize tool when you visit the main page and it works just fine, but when you click on another main tab, it's completely disabled. I think the ajax is causing the elements to become disabled because they only load on document.ready. What other approach can I take to keep these scripts working?

Your syntax for the .load() method looks wrong. Refer to this:
http://api.jquery.com/load/
Should be something like
$('#ajax').load(url, function() {
//do hover binding
});

$('#ajax').load()(function(){
btn.js:1Uncaught TypeError: object is not a function
$(".btn").hover(function(){
$('.end-rght-h, .end-rght-v',$(this).parent()).addClass("hvr");
},
function(){
$('.end-rght-h, .end-rght-v').removeClass("hvr");
});
});
Something is breaking on that load somewhere..
Plus
Uncaught TypeError: object is not a function
doctors.jpgGET http://www.steadfastdesignfirm.com/rgw/BASE_URL/images/headers/doctors.jpg 404 (Not Found)
barazi.jpgGET http://www.steadfastdesignfirm.com/rgw/BASE_URLimages/pages/doctors/barazi.jpg 404 (Not Found)
berinstein.jpgGET http://www.steadfastdesignfirm.com/rgw/BASE_URLimages/pages/doctors/berinstein.jpg 404 (Not Found)
byrnes.jpgGET http://www.steadfastdesignfirm.com/rgw/BASE_URLimages/pages/doctors/byrnes.jpg 404 (Not Found)
deegan.jpgGET http://www.steadfastdesignfirm.com/rgw/BASE_URLimages/pages/doctors/deegan.jpg 404 (Not Found)
desai.jpgGET http://www.steadfastdesignfirm.com/rgw/BASE_URLimages/pages/doctors/desai.jpg 404 (Not Found)
Base url? Something incorrect there.. You need to debug your site big time man.
Like Research link
research.phpGET http://www.steadfastdesignfirm.com/rgw/research.php 404 (Not Found)

Related

jQuery Load doesn't works - Page Not Found 404

This is like 8 hours into this that I'm trying to fix it.
This might be a petty issue, but I'm not sure why in the world it isn't working.
I'm trying to refresh a div with jQuery.Load but it throws a weird 404 error. The page does exist and I'm not sure why it ain't taking it.
It was working well before when I hadn't added wordpress header files. Once I added them, it went haywire.
Here's my code
$( "#feed" ).load(window.location.href + " #feed" );
I've also tried this :-
$( "#tab1" ).load("http://example.com/community.php?#tab1" );
The JS code is written on the same file community.php
Here's the error :-
Failed to load resource: the server responded with a status of 404 (Not Found) community.php:1
All the examples I see have a space between the selector and the URL. Like so:
$("#tab1").load("http://example.com/community.php? #tab1");
Ref: http://api.jquery.com/load/ - "Loading Page Fragments"
Also, it seems problematic to load a fragment into a div that has the same id. If the space does not resolve the issue, try removing the #tab1 id from the page?
$("#tab1_target").load("http://example.com/community.php #tab1");
Also just noticing that ?... which seems odd as you are not passing any GET parameters. Not sure how well you copied your actual code into the question so this might all be moot.

How to outsource this file [duplicate]

The code below was fully working when it was placed inside <script></script> tags on the running page. I since moved the code to an outside .js file for organizational purposes which caused the code to stop working - nothing happens when certain events should be fired. I ensured that the script was being included on the given page, and furthermore, I ensured that the link was valid through "view-source" (when I clicked on the script's path, the script loaded in a new window).
The script declarations:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="js/main.js"></script>
So, what does my JS look like in this external file?
(function(){
$('#display-reply-box').click(function(){
$(this).hide();
$('#submit-reply-wrapper').show();
});
})(jQuery);
I removed most of the methods for readability, but that is how the file is setup. I ensured that there were no .js errors in the console, however, I did get the following errors regarding jQuery and Firelite
Failed to load resource: the server responded with a status of 404 (Not Found) http://getfirebug.com/releases/lite/skin/xp/pixel_transparent.gif
Failed to load resource: the server responded with a status of 405 (Method Not Allowed) http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
I would assume the above errors have something to do with the problem I'm experiencing, although I've had no luck getting them to disappear. At times the errors are there, other times they are not.
It seems as though you're attempting to run something on an element that might not have loaded in the DOM. Try wrapping it in a DOM Ready event handler like this:
(function($) {
$(document).ready(function() {
$('#display-reply-box').click(function(){
$(this).hide();
$('#submit-reply-wrapper').show();
});
});
})(jQuery);

get content loaded with json

Installed an app for shopify (qucik view) which shows product in a popup. It looks like all of the content and data is loaded into divs with specific id's an classes with json. I'm trying to pull and edit some parts of it (like hrefs) with jquery, but have no luck. I'm new to js, so it look like there is something i don't know.
Trying to make it with standard jquery lines
$(".sca-qv-showqv").each(function(){
var ttlhref = $(this).find("#sca-qv-detail").attr("href");
$(this).find("a.sca-qv-title").attr("href",ttlhref);
});
My guess is that it's trying to pull data before all of it is loaded. I've also tried window load, and no luck with that. Errors from console:
Uncaught Error: Syntax error, unrecognized expression: .main-nav ul li ul. .superimage img
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:4 load jquery 1.11
jquery.js:9592 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 collection_handle : undefined
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 Disable QV :
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 image_zoom_type : original
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 image_show_type : large
foundation.min.map:1 GET http://cdn.shopify.com/s/files/1/0519/3185/t/10/assets/foundation.min.map 404 (Not Found)
app.css.map:1 GET http://cdn.shopify.com/s/files/1/0519/3185/t/10/assets/app.css.map 404 (Not Found)

Undertermined Javascript Error

I have implemented the .NET Login functionality, and I am receiving a JavaScript Error whenever a User clicks on the Log-In Anchor Button to reach the Login.aspx.
This Anchor Menu Button is part of the CSS Menu which is defined within the Master Page.
When I run this locally, the error indicates:
'ddmegamenu' is undefined
However this script is defined within the MasterPage:
All of the sub-pages can see this script including the Login.aspx:
<script type="text/javascript">
ddmegamenu.docinit({
menuid: 'solidmenu',
dur: 200 //<--no comma after last setting
})
</script>
Here is the development site: http://www.virtualpetstore.com
The Login.aspx is within a seperate Account Directory, but I don't think this should be a problem.
If anyone can see this issue, I would really appreciate it.
You're getting the error because you're not properly referencing the JS files on the Login.aspx page. This is what the console says (in addition to the error that you posted):
GET http://www.virtualpetstore.com/Account/js/jquery.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery-1.5.min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery-ui.min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.serialScroll-min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/ddmegamenu.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.scrollTo-min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.simplemodal.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.cycle.min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.actual.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/contact.js 404 (Not Found)
Ensure that your JS files are being loaded and your error will most likely disappear.
Hint: Your script tags should look something like this:
<script type="text/javascript" src="/js/ddmegamenu.js"></script>
The problem is simple, on Account/Login.aspx you try to include Account/js/ddmegamenu.js
but you need on this url /js/ddmegamenu.js

Call jQuery Function after ajax load

So, the thing is i'm trying to import a slider with ajax, the slider works if you access the page directly:
http:// www.iloja.pt/ajaxload/ipod.php
if you try to access iloja.pt and click "reparações" and after that click "iPod" it calls the ipod.php page but the slider doesn't work. I tried to include the js files in many ways but the
i know i have to use bind function, but don't know how to do it.
There seems to be some javascript errors, specifically:
"animation is not defined"
You have many errors in that page, see Javascript console on Chrome or Firebug on Firefox.
In particular I can see this errors:
Failed to load resource: the server responded with a status of 404 (Not Found) [http://www.iloja.pt/js/jquery.ennui.contentslider.js?_=1326816532863]
Uncaught TypeError: Object [object Object] has no method 'ContentSlider'
your problem is that the browser can't load the contentslider.js library so you have an exception when using ContentSlider Method.
Try to fix the loading of the js.
Have you tried adding the async: 'false' parameter to your ajax call, that way it should load your code entirely before doing anything else...

Categories