jQuery Load doesn't works - Page Not Found 404 - javascript

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.

Related

IE8 shows 500 page when it contains regex with script replace

IE8 seems doesn't allow to replace <script> e.g:
someHtml.replace(/<script.+<\/script>/g, "")
and page with that script fails to load providing that information:
The website cannot display the page HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.
What you can try:
Refresh the page. Go back to the previous page. < sarcasm>Use normal browser.< /sarcasm>
More information
This error (HTTP 500 Internal Server Error) means that the website you
are visiting had a server problem which prevented the webpage from
displaying.
500 (!!) error when it clearly not server error (but wait, that's IE nothing to wonder)
However when I change script to div like so:
someHtml.replace(/<div.+<\/div>/g, "")
It works.
So I have that feeling that it is some IE bug so it tried to read <script as a start of script element and it fails (managed to find out that 500 error displayed even when there is not escaped slash / e.g. /<div.+</div>/g )
Or maybe there is some setting in IE that prevents to do things like that for some security means.
Can someone confirm that it is a bug or some setting needed or even something else?

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)

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?

Website Home Page redirects to a blank page

I have developed a website but when I access it by typing http://phalkefmcg.com it redirects to a blank page. But if I access another page like http://phalkefmcg.com/about.html it comes up properly. I have used Jquery and Javascript codes, but none of them have any redirect code. Is it a attack on my website? How can I resolve it?
I've digged out the problem to http://remysharp.com/downloads/jquery.marquee.js. It says:
// you're seeing this because you're hot-link a script that can be pulled from an
// alternative source. This script is only activated after a few months of trying
// to get in touch and requesting that you stop hot linking
setTimeout(function () {
document.open();
document.write('');
document.close();
}, 2000);
console.log('Sorry, but you should not hot link files from regular blogs in case they do something like this. Best remove the hot linked files and you will be sorted again.');
So, remove the linked JavaScript file. (On line 118 of index.html)
You have an errors in your JS. It appears to be removing all markup from your page. Open your browser's dev tools console to see the errors. In Chrome Is see:
Sorry, but you should not hot link files from regular blogs in case they do something like this. Best remove the hot linked files and you will be sorted again. jquery.marquee.js:9
Uncaught TypeError: Object # has no method 'infiniteCarousel' http://phalkefmcg.com/:20
Uncaught TypeError: Object # has no method 'overlay'
NOTE: You really should post code here instead of links. This question has no value to the community once your page is fixed.

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