get content loaded with json - javascript

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)

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.

jQuery: Accessing error code if image fails to load

I have a page where users can add images (browse for files, drag/drop or copy/paste) from their filesystem, clipboard, or external websites. If an image fails to load, I'd like to let the user know why. For example, 404 (resource not found) or 403 (Forbidden) - users may want to try different things depending on why the image failed to load.
I'm dealing with failure using the following code:
var image=$('<img>').appendTo(container);
image.error(function(e){/* error handling code*/});
image.attr('src','example.jpg');
I can't figure out how to access the particular error code that led to failure. If I open developer tools (chrome), the error message gets displayed there... how can I access that same message in my code?
You can try this.
var img = $.get("/img/example.jpg");
var statusCode = img.status,
statusText = img.statusText;

Javascript "Access is Denied" error when trying to use jquery plugin with jQuery 1.7.1

A jquery plugin named "binaryajax.js" exists that can be used to read and examine data from images. When I try to include this script in my page (just including it, without even using it), I get a javascript "Access is Denied" error in jQuery 1.7.1. No other jquery plugin I have ever used has had an error like this. I have seen no other reference to anyone else having this error except for me. I would like to be able to use this because I need to examine the EXIF orientation tag inside of an image file in javascript, but this error is preventing me from doing so. Can someone explain why I would be getting this and what I can do to make it work for me? Here is the reference to binaryajax.js:
http://www.nihilogic.dk/labs/binaryajax/binaryajax.js
All I am doing to get the error is to include the following in my page:
<script src="~/Scripts/binaryajax.js"></script>
What am I doing wrong, if anything?
EDIT:
Through much trial and error, I tracked down what is causing the error, although I still do not know how to correct it:
On my home page I have two links of the following format:
<a onclick="$('#home-form-settings').submit();">
Each one has click-event handlers that point to a form on the home page and will cause a submit of the form.
These links are not even on the page where I am including and trying to use binaryajax.js, but because they are on the home page they for some reason get included in every other page I visit in my asp.net MVC web application. If I remove these links, I do not get the Access Denied error but their presence is preventing me from using this plugin. Does that make sense?
How can I use the plugin on some other page and keep these links on the home page?

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...

Jquery and Java Script does not work an all pages

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)

Categories