jQuery waypoints not working on localhost - javascript

I'm trying to use jQuery. From jQuery Waypoints I downloaded the example shortcut for infinite scroll. When I checked the web console it gives the following error when it hits the end of the page.
XMLHttpRequest cannot load file:///Users/akash.bansal/Downloads/imakewebthings-jquery-waypoints-415eb55/shortcuts/infinite-scroll/. Received an invalid response. Origin 'null' is therefore not allowed access.`
Edit
Well, that error came because I was accessing a file from a file which got resolved when I allowed the file access in Chrome, but the jQuery-infinite scroll is still not working on localhost!!

Apart from opening Chrome and allow access to the file from other files...
An href link says:
<a href=".">
I changed it to the absolute path. It's working fine for me.

Related

Recaptcha v3 initialization interrupted

Recaptcha v3 initialization is not completing when using the production site.
The logo is no longer appearing and if I try to submit the form I'm getting this error : "Uncaught Error: Invalid site key or not loaded in api.js"
It's working when I'm using it on localhost from my PC
The only difference between the dev and the prod are the keys.
Any idea to why it's not loading properly ?
Changed the keys.
Tried on other web browsers.
There's 2 main ways I believe this is caused:
Your domain name should just be the domain. apple.com, not https://apple.com
Make sure you are including the sitekey in the render param when you add the script tag:
<script src="https://www.google.com/recaptcha/api.js?render=<v3_site_key>"></script>
I've gotten the error when I forgot to provide the site key here (originally thought I only had to pass it in as the first argument to grecaptcha.execute)

Soundcloud embedding problems in Firefox

I've been working on a project where I need to embed Soundcloud songs. Everything works if I try to open the page in Chrome, but in Firefox, it simply shows a gray box with the Soundcloud logo in the center.
I was trying to debug it, and here's what I see in Firebug. When I open the page, it says
TypeError: this.getFlashPlugin(...).match(...) is null
and
Error: Permission denied to access property "href"
I've been searching for it since 2 days now, and I almost came to a conclusion that this can not be fixed, no matter what, then suddenly, a jsfiddle url came up in the search result and I saw soundcloud embeds working fine in both Firefox and Chrome.
Now, here's the original jsfiddle url: http://fiddle.jshell.net/Peeters_William/kpkdnrts/
What I did, was copying the exact same code, including the HTML and Javascript part to a NEW jsfiddle document which can be found here: https://jsfiddle.net/etLwq8kv/
I'm literally clueless: Why is the first fiddle working without any problems and this second one refuses to embed the songs? I believe that I have the exact same copy of the first code and still, it refuses to display..
I have even changed all the settings I saw on the first fiddle such as
CSS panel -> Normalized CSS
HTML panel -> Doctype: HTML5, Body tag:
Javascript panel -> Language: Javascript, Frameworks: No-Libary (pure JS), Load type: onLoad
Still, even if I believe that the two fiddles are the exact copies, why is this second one refusing to work properly?
Thanks in advance and have a great day everyone!
After checking the network for some clues, it became apparent to me that the script wasn't being loaded at all. I started double checking everything and I noticed that the url from the working example did differ from yours not only by the url (https://jsfiddle.net and http://fiddle.jshell.net) but also by the protocol.
In the working example, the protocol was HTTP and so was the Soundcloud's API. However, your example was in a secured connection and the API's address wasn't. Which explains the "Permission denied to access property href message."
Fortunately, Soundcloud provides a secured version of the API. I fixed your example by changing the protocol to HTTPS and it started working.
Change HTTP protocol
http://connect.soundcloud.com/sdk.js
to HTTPS
https://connect.soundcloud.com/sdk.js

jquery conflict with my website

I layout'd a page and on my server which is it hostgator works extremely fine, using the jQuery mobile components:
http://brunolustro.com/roger/teste/cadastro.html
But my friend who is programming the page wanted me to insert the newest CDNs from either jQuery and jQuery Mobile:
And this is what the page looks like when I insert those codes:
http://brunolustro.com/roger/test/cadastro.html
Do you know how to fix this?
Regards,
Bruno
When working with JavaScript or jQuery on your website - if something isn't working as you intend - the first thing you should do is check the browser console to see if anything is being logged there.
To check the browser console:
Hit F12 on your keyboard. When the developer tools open, choose the console tab, its placed in the toolbar at the top of the new window.
In the console you will see a few errors in red with error codes (404). A 404 means the requested file wasn't found.
This tells us that your reference to jQuery isn't correct. This could be because the file path you've written isn't correct, or that you haven't deployed those files correctly to your site.
Check your file paths you've referenced and make sure the file is on your server. Once both are correct - the errors should go away.
Here's a link to view more about developer tools: https://developer.chrome.com/devtools#console
Check following files in your "test/js" and "teste/js" folders, because i've got 404 not found error:
jquery-2.0.3.min.js
modernizr-2.6.2.min.js
jquery.mobile-1.4.5.min.map

jQuery ui slideshow not working

So I created a simple slideshow with jquery and jquery ui. It works perfectly when I dragged the html into chrome, but when I uploaded the file to my server, the effect didn't work.
You can see the website on -guyzyl.org- (its the main page), or just the html file (which is the same as the one on the site -https://www.dropbox.com/s/0q3tnshbvmxu9ax/index.html-
any help is appreciated, and thanks in advance.
You are missing all these js .. (Seen in firebug in console error)
"NetworkError: 403 Forbidden - http://jqueryui.com/latest/ui/jquery.effects.core.js"
jquery...core.js
"NetworkError: 403 Forbidden - http://jqueryui.com/latest/ui/jquery.effects.slide.js"
jquery...lide.js
error: "NetworkError: 403 Forbidden - http://jqueryui.com/latest/ui/jquery.effects.slide.js"
Also . i would suggest you to read from google CDN ( this jquery ui contains all the effect files)
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js
While keeping a local copy of it, so that in case it is not able to get it from google cdn , it can look in local path .(as in your case and doesn't brake your website)
Nothing is wrong with the code itself: http://jsfiddle.net/ya8Yu/ is all of your code working.
you need to get your included files setup properly as Fidrizers suggested.
Also, in the future set up a jsfiddle so that we dont have to run around to gather all of your code and set up an environment to test.

javascript failing with permission denied error message

I have a classic ASP web page that used to work... but the network guys have made a lot of changes including moving the app to winodws 2008 server running iis 7.5. We also upgraded to IE 9.
I'm getting a Permission denied error message when I try to click on the following link:
<a href=javascript:window.parent.ElementContent('SearchCriteria','OBJECT=321402.EV806','cmboSearchType','D',false)>
But other links like the following one work just fine:
<a href="javascript:ElementContent('SearchCriteria','OBJECT=321402.EV806', 'cmboSearchType','D',false)">
The difference is that the link that is failing is in an iframe. I noticed on other posts, it makes a difference whether or not the iframe content is coming from another domain.
In my case, it's not. But I am getting data from another server by doing the following...
set objhttp = Server.CreateObject("winhttp.winhttprequest.5.1")
objhttp.open "get", strURL
objhttp.send
and then i change the actual html that i get back ... add some hyperlinks etc. Then i save it to a file on my local server. (saved as *.html files)
Then when my page is loading, i look for the specific html file and load it into the iframe.
I know some group policy options in IE have changed... and i'm looking into those changes. but the fact that one javascript link works makes me wonder whether the problem lies somewhere else...???
any suggestions would be appreciated.
thanks.
You could try with Msxml2.ServerXMLHTTP instead of WinHttp.WinHttpRequest.
See differences between Msxml2.ServerXMLHTTP and WinHttp.WinHttpRequest? for the difference between Msxml2.ServerXMLHTTP.
On this exellent site about ASP you get plenty of codesamples on how to use Msxml2.ServerXMLHTTP which is the most recent of the two:
http://classicasp.aspfaq.com/general/how-do-i-read-the-contents-of-a-remote-web-page.html
About the IE9 issue: connect a pc with an older IE or another browser to test if the browser that is the culprit. Also in IE9 (or better in Firefox/Firebug) use the development tools (F12) and watch the console for errors while the contents of the iFrame load.
Your method to get dynamic pages is not efficient i'm afraid, ASP itself can do that and you could use eg a div instead of an iframe and replace the contents with what you get from the request. I will need to see more code to give better advice.

Categories

Resources