Javascript JSONP on Googlechrome - javascript

I have a code, from here:
http://www.onlinesolutionsdevelopment.com/blog/web-development/javascript/jsonp-example/
I tested it on Firefox with two domains, it works perfectly. But when I tried it on Google Chrome I get this warning:
Resource interpreted as Script but transferred with MIME type text/html:
and this error:
Uncaught SyntaxError: Unexpected token <"
I haven't tried it on IE yet, but it's not a big deal. I can't figure out what seems to be the problem, and I'm kinda new to this kind of stuff.
Note: I dont want to use JQuery

After spent some time on this, I discovered that my problem is not on my script , but its on my freewebhosting added script, then i tried to disabled their script, and it works fine, but anyways thank you guys.

Related

Getting 'Uncaught TypeError: Cannot set property 'timestamp' of undefined' when using jQuery

I have an error which appear when I import jQuery lib only. I don't know what I can do. I know that it's coming from the file jquery.min.js.
Here is my simple page causing this error :
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
What I get from my console :
This error has nothing to do with jQuery or its CDN.
From the error log, you can see that the error originates from webspeed.js. Since you precise that you only import the jQuery script, this shows that this error originates from an extension.
The script tries to contact speedtest.net and the request gets blocked by CORB, thus throwing an uncaught error. This also gives a hint that the extension is made likely to be offered by speedtest.net or a related corporation. As #alon-eitan found, this is indeed the case: the speedtest extension includes such a script that has been known for triggering similar errors.
Pausing the extension or configuring it not to run on your website is likely to fix the error. I'd recommend removing it completely, as network speed analysis and much more can already be natively performed by Chrome thanks to Lighthouse.

Angular 2 ZoneAwareError in Tutorial, but only for chrome

Hello here and thanks for helping !
I'm performing the angular tutorial tour of heroes, and I have ended the point 4.Multiples Components, but the content does not load (we see "Loading AppComponent content here ...") and I have this error on chrome developper tools:
ZoneAwareError {__zone_symbol__error: Error: (SystemJS) Invalid or unexpected token
SyntaxError: Invalid or unexpected token
at eval…, __zone_symbol__stack: "(SystemJS) Invalid or unexpected token↵ SyntaxErro…n.js↵ Error loading
I can't paste more because the error is displaying a very lot of information.
The real problem is here: At this point of the tutorial, my app work perfectly on edge and firefox... I don't understand what is wrong with chrome :/ ...
Thanks
Ok it's seem it's a problem with chrome browser cache... The bug appear at randomly moment, and I have to delete it integraly if I want to see my code working...
I don't know why this error but that fix the problem. Sorry for this, and thanks.

Resolving Unexpected token < in Chrome for Custom 403 Page

I saw some previous topics related to this but was unable to find a related solution.
On my WordPress blog, WeLearnChess.com, I created a custom 403 error page, and now I am getting a seemingly related syntax error in Chrome. I enabled script debugging in the wp config file and checked with developer tools in Chrome, and I get this error:
Uncaught SyntaxError: Unexpected token < inaccessible:1
This appears to refer to my custom 403 page (http://www.welearnchess.com/inaccessible/). I have BulletProof Security Pro installed, so, to create the custom 403, I replaced the default 403 code with the following line of code via the BPS custom code field:
ErrorDocument 403 http://www.welearnchess.com/inaccessible/
From various tutorials that I saw online, this seems like it should be correct, but I'm new to this so perhaps I've made a mistake that is causing the error. Another interesting point is that, after a hard browser refresh, sometimes the syntax error temporarily changes from :inaccessible to :index or maybe it was:index1 (I'm having trouble reproducing it now).
So, have I done something incorrect with my 403 custom code that could be causing the aforementioned error? Thanks in advance for any assistance you can provide, and please let me know if I need to clarify the question further.
You plugin directory is throwing a 403 error, which means when including <script> tags with src like http://www.welearnchess.com/wp-content/plugins/ultimate-social-deux/public/assets/js/min/us.script-min.js?ver=6.0.4 get redirected to your custom 403 page which is http://www.welearnchess.com/inaccessible/. There are a few instances of this for plugins: ultimate-social-deux, zf-wordpress-category-accordian, rain - where their assets that should be publicly accessible are 403ing. Which means, instead of the actual script your custom page is loaded in the script tag, which is as expected, is invalid JavaScript and hence the errors in your console.

HTML Loader not working on certain pages

I am designing a website and am having some issues on certain computers. Most computers show the site perfectly, but certain computers just load a blank grey screen.
My work computer is one that has an issue,
The website is http://holidayinnkilgoretx.com and loads fine on the home page and photo page, but when I go to http://holidayinnkilgoretx.com/raa.php it messes up. Please let me know If i have something wrong in my code which is causing this. I checked all divs and closing tags etc.
It also only has the issue in google chrome.
Thank You
Getting the following load errors from Google developer tools which you should look into:
Resource interpreted as Script but transferred with MIME type text/html: "http://holidayinnkilgoretx.com/js/jquery.imagesloaded.min.js".
raa.php:315
Uncaught SyntaxError: Unexpected token <
js/jquery.imagesloaded.min.js:1
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
jquery.min.js:5
Uncaught TypeError: Cannot call method 'create' of undefined

JavaScript Error line 1 <ANYJAVASCRIPFILE.JS> SyntaxError: Parse error IN Iphone mobile safari

I keep getting this error when I run my web app (asp.net mvc) in the mobile safari (ITouch)
JavaScript Error line 1
SyntaxError: Parse error
JavaScript Error line 1
SyntaxError: Parse error
I have no problem running this in any other browser (including safari).
I suspect this is something to do with mobile safari handling javascript files.
I am using MicrosoftMvcAjax.js and Jquery.
The above error is totally useless to me and I couldn't figure out where to debug or start.
Any help would be appreciated.
Thanks
The URL is resolved by the client, which doesn't know about the application.
To get a relative path for the client, you can write
<%= ResolveClientUrl("~/Scripts/MicrosoftAjax.js") %>
Turns out the src attribute for the Javascript is the problem.
For some reason is taking me to the domain root instead of the application root.
So instead of looking for http://localhost/application/scripts , the page is looking under
http://scripts...Don't know why?
The Parser error is simply file not found error.
Thanks everyone

Categories

Resources