how to inject JS Console in to https page? jsconsole.com - javascript

I have added script tag as follows working on a https website.
<script src="http://jsconsole.com/remote.js?xxx-xxxx-x-xx-xxxx"></script>
I replaced the http to https still no luck.
<script src="https://jsconsole.com/remote.js?xxx-xxxx-x-xx-xxxx"></script>
I have downloaded remote.js and added relative path still no luck.
<script src="js/remote.js?xxx-xxxx-x-xx-xxxx"></script>
Any suggestion?

Related

Loading jquery script from CDN works, but loading same script from IIS yields illegal character?

In my static webpage loaded from IIS (v8.5.9600), I include jquery with the following:
<script type="text/javascript" src="js/jquery.min.js"></script>
And when loading the page in the firefox browser I get the following error in my console:
Uncaught SyntaxError: illegal character [Learn More] jquery.min.js:1
If I load it from the CDN, everything is fine, my code runs and I get no errors (my code is in the html page and thus not included from another script).
<script type=“text/javascript” src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js">
I downloaded the file from the CDN and copied it directly into IIS, but when it loads I still get the error in Firefox about an illegal character.
Both of the files from the CDN and IIS load up, so that is not the issue, but I did notice that when the file is loaded from the CDN it looks like this:
But when I load it from IIS (v8.5) it looks like this:
P.S. I tried loading a simple script from IIS (not from the CDN) as well and I get the same error. Is it something to do with IIS's settings?
Check the browser network tab snapshot which shows the script file name and make sure it loads up on its own from the URL you specfied in the src attribute of your <script> tag.
Your Javascript <script> include tags need to have the charset="utf-8" attribute so that the browser requests the script from the server in the utf-8 encoding.

chrome app add local script and script from url

I'm starting a chrome app. But things like this doesn't work for security reason.
<script src='https://code.jquery.com/jquery-1.11.0.min.js'></script>
<script src='app.js'></script>
So how to add those 2 kind of script to my app?
I tried different things in the manifest file but none of them have been successfull
The simplest way to avoid security issues is to download jquery-1.11.0.min.js and place it in your script directory. This will ensure you won't have security SOAP issues. Then include the files like this:
<script src='/example_local_directory/jquery-1.11.0.min.js'></script>
<script src='/example_local_directory/app.js'></script>

force react.js to load depenencies via ssl

I have a Play framework app which handles sensitive data and so enforces SSL.
I'm building a frontend with React.js , but when I try to load
<script src="https://fb.me/react-0.11.1.js" type="text/javascript"></script>
<script src="https://fb.me/JSXTransformer-0.11.1.js" type="text/javascript"></script>
I get the error
[blocked] The page at 'https://localhost:9443/react' was loaded over HTTPS, but ran insecure content from 'http://dragon.ak.fbcdn.net/hphotos-ak-xpf1/t39.3284-6/10173493_255140104677950_2108691993_n.js': this content should also be loaded over HTTPS.
How can I enforce that the transient dependencies are also loaded via https?
The Facebook "CDN" for React doesn't work over HTTPS right now, sorry. You can instead use cdnjs:
http://cdnjs.com/libraries/react
Your script tags will look something like
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.11.1/JSXTransformer.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.11.1/react.js"></script>

JQuery UI Tabs break in secure (https) page

I'm using the out-of-the-box JQuery UI tabs- they work fine on an unsecured page but not on the secure https:// page.
I'm calling my scripts like this:
<script src="//code.jquery.com/ui/1.8.22/jquery-ui.min.js" type="text/javascript"></script>
<script src="//jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="//jquery-ui.googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>
Examples here:
http://ntcla.com/fb-static.php and
https://ntcla.com/fb-static.php
(see map at the bottom of the page)
Any help is appreciated!
It looks like there is an SSL cert error on the code.jquery.com link. You could just download it and host it on your own site/CDN.
SSL certificate error will be thrown when you try using any js in following manner
download above files and copy them on your server and access them using relative paths on your script

link to external javascript file in a subdirectory from a web host

I have my index.html at the root of my web host, and my javascript file is in a directory(JavaScript) which is also at the root. How can I link my index to the js file? I did the following, but it's not working: <script type="text/javascript" src="JavaScript/filename.js"></script> in the head. It works when I do the inline javascript
<script type="text/javascript" src="JavaScript/file.js"></script>
Loads the file.js in the subdirectory "JavaScript". It'll work unless a base href is specified.
Edit: I see now that's pretty much what you had. Should work. You got full code or URL?

Categories

Resources