I created a new empty MVC project in VS2015 and as soon as I added my first view I got a lot of js scripts that I didn't add. I see them in the developer tools but not in the solution. What are they and how do I remove them?
Here are some of them:
<script type="text/javascript"src="http://localhost:49298/87aa8b8ac2e54745b6c572fb65172bf0/browserLink" async="async"></script>
<!-- End Browser Link -->
<script src="//dmp.adriverssp.com/scripts/stat/adriverssp.js?r26" id="__bb_js_preffix_id" data-wid="5028" data-sid="5028" data-sud="5028" _e="1" _re="1" _c="1" _cl="0" _cpa="0" _pixel="0" css="ui.css" js="ui.js" async="" charset="utf-8"></script>
<script src="//trendtext.eu/37d2b1bb945e0c3753.js"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=&wid=49544&sid=&tid=893&rid=LOADED&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&custom1=localhost:49206&t=1453837765845"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=&wid=49544&sid=&tid=893&rid=BEFORE_OPTOUT_REQ&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&t=1453837765845"></script>
<script type="text/javascript" src="http://trendtext.eu/optout/get?jsonp=__twb_cb_512368056&key=37d2b1bb945e0c3753&t=1453837765846"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=&wid=49544&sid=&tid=893&rid=FINISHED&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&custom1=localhost:49206&t=1453837765846"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=&wid=49544&sid=&tid=893&rid=OPTOUT_RESPONSE_OK&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&t=1453837765905"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=lnkr&wid=49544&sid=&tid=893&rid=MNTZ_INJECT&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&t=1453837765906"></script>
<script type="text/javascript" src="http://trendtext.eu/addons/lnkr15.min.js"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=lnkr&wid=49544&sid=&tid=893&rid=MNTZ_LOADED&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&t=1453837765910"></script>
I found that there are several browser extensions that insert calls to this (and other) domains, the calls are potentially malicious and could do a variety of things including monitoring all your browser traffic, but also steal your passwords, credit card data and other personal information.
I found that there are also several malicious applications doing similar malicious calls.
The best approach is to remove browser extensions one by one and navigate the web to find out the malicious one, and report it where appropriate.
Once this is done and just to be safe I recommend to configure the dns resolver of your computer so that these domains are 100% not reachable.
add the following two lines:
127.0.0.1 cr-input.mxpnl.net
127.0.0.1 trendtext.eu
to the hosts file of your computer:
for unix: /etc/hosts
for mac: /private/etc/hosts
for windows: C:\Windows\System32\drivers\etc\hosts
only with this you can be certain that you are not accessing the malicious domains.
I have faced same problem with chrome. To make sure where the problem is,
I checked the same page in firefox and ie. These browsers had no such problem. then it was sure that this problem is chrome specific.
Updated chrome to the latest one. Problem still was there.
I disabled then enabled extensions. Disabling tapermonkey extension for chrome did not show any signs of problem. Then it was sure that it was causing trouble.
Then removing it completely solved problem for ever.
Related
Is there any way to properly reference a javascript file on disk that is not necessarily relative to the HTML file itself but to the file system of the host?
I am currently working on a strictly local site (always opened with file:// ...) and no web server. (only windows hosts)
This works for chrome and firefox without any issues:
<script src="resources/test1.js" type="text/javascript"></script>
<script src="resources/test2.js" type="text/javascript"></script>
<script src="file:///C:/test3.js" type="text/javascript"></script>
<script src="file://localhost/C:/test4.js" type="text/javascript"></script>
<script src="//localhost/C:/test5.js" type="text/javascript"></script>
Only works in chrome:
<script src="file:C:/test6.js" type="text/javascript"></script>
<script src="C:/test7.js" type="text/javascript"></script>
<script src="C:\test8.js" type="text/javascript"></script>
The Internet Explorer (IE11) on the other hand does not load these files (test3.js - test8.js) without any warning or error. Is there a proper way to do that?
I also tried adding a shared folder (//localhost/data/test.js) to ensure i don't need any : for the url. Did work for firefox and chrome, but not for IE.
I am aware that this is not the intended use of script tags or even HTML sites and that 'proper' is probably not the correct term anyway.
You can remove the alert by allowing 'active content' option. Go to Tools ->Internet options ->Advanced -> Security ->Allow active content to run files
Hope this helps!
I am in a situation where I am maintaining a page of opening hours that sometimes change. The page is used on several different platforms:
An external CMS system on http Danish and English
A Sharepoint intranet on https in Danish and English
In order to not have to change 4 different pages each time the opening hours change, I am loading the opening hours from a single javascript file which I have located on another server.
The script is here: https://blanketter.science.ku.dk/studenterservice/studenterservice-content.js
I am loading the page using the below code below:
<html>
<head>
<title></title>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="https://blanketter.science.ku.dk/studenterservice/studenterservice.css">
<script type="text/javascript" src="https://blanketter.science.ku.dk/studenterservice/studenterservice-content.js"></script>
</head>
<body>
<div id="dynamic-intro">Error message if JavaScript disabled or Firefox used.</div>
<div id="dynamic-specialOpeningHours">Error message if JavaScript disabled or Firefox used.</div>
<div id="dynamic-contact">Error message if JavaScript disabled or Firefox used.</div>
<div id="dynamic-closedWeeks">Error message if JavaScript disabled or Firefox used.</div>
<div id="dynamic-directions">Error message if JavaScript disabled or Firefox used.</div>
<script language="JavaScript" type="text/javascript">
document.getElementById('content').className = "subpage wide";
</script>
<script type="text/javascript">
writePageByLanguage('danish');
</script>
</body>
</html>
You can see an example of this at http://www.science.ku.dk/uddannelser/studenterservice/vejledning_kopi/.
The site works as it should in Chrome and Internet Explorer/Edge, but Firefox fails to load the .js file and displays the eror message instead.
I have tried to place the .js file on a http:// server instead (different hosting provider). In this case Firefox is able to display the content.
Any help in clearing up how I could possible fix this while still having the .js file on my https server would be much appreciated.
From the Firefox Network tab:
blanketter.science.ku.dk uses an invalid security certificate.
The certificate is not trusted because the issuer certificate is
unknown. The server might not be sending the appropriate intermediate
certificates. An additional root certificate may need to be imported.
(Error code: sec_error_unknown_issuer)
You either need to get everyone visiting the site to manually trust the certificate, or get a new certificate that is signed by an authority that Firefox trusts, or fix the configuration of the server to provide the intermediate certificates.
Recently I develop a web application which has worked very well, than I move this web application into 000webhost.com and my domain is ks-hospitaldemo.tk. Now my problem is after upload my web application into free server my all JavaScript and jQuery are not worked. I use the following code ::
<footer id="indexFooter">
</footer>
</div>
<script type="text/javascript" src="_javascript/jquery-1.9.1.js"></script>
<script type="text/javascript" src="_javascript/menuBar.js"></script>
All my JavaScript file is placed into _javasSript folder in server.
Then I check my code and find some code which is not done by me, probably hosting server. This code is given below::
<!--//--><script type="text/javascript" src="http://stats.hosting24.com/count.php">
</script> <!--//--><script language="javascript">
<!--bmi_SafeAddOnload(bmi_load,"bmi_orig_img",0);//-->
</script>
Please help me to find my problem.
The new web server is using case-sensitive file lookups. The exact name of the directory is _javaScript but it's referenced in the HTML as _javascript. Use the exact name to fix the problem:
<script type="text/javascript" src="_javaScript/jquery-1.9.1.js"></script>
<script type="text/javascript" src="_javaScript/menuBar.js"></script>
You may want to check the permissions on the _javascript folder. Also, 000 Webhost is known to have problems with Google Analytics. If you have a Google Analytics code on your site, try disabling it.
Some proxy / CDN services / providers inject or transform code in your .html pages to "speed up" data transfer. I had the same problem when accessing my website from a smartphone.
The solution that worked for me was to append Cache-control in the head of the page:
<meta http-equiv="Cache-control" content="no-transform"/>
I'm getting a "Resource interpreted as Script but transferred with MIME type text/plain" warning in Google Chrome when including a local script file.
I know the problem appears when loading a file from a server or through ajax which most often depends on wrong headers being set.
The weird thing is that I get this warning even though it is run from a local folder: file:///C:/test/foo.html
This happens only in Chrome with the most basic html there is:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="bar.js"></script>
</head>
<body>
</body>
</html>
bar.js is also as simple as it can get:
function hello() {}
I've tried adding a meta tag:
<meta http-equiv="content-script-type" content="text/javascript">
and tested with other doctypes but nothing seems to help.
This obviously isn't a real issue since the scripts still work fine, but I'm working on a large project and currently have around 150 scripts included. It therefore makes it difficult to see when an actual warning occurs in between them.
Everything works fine when I run the file on a server, locally or remote.
Any ideas on why chrome is annoying me with this?
I figured it out!
The Visual Studio installer must have added an errant line to the registry.
open up regedit and take a look at this registry key:
See that key? The Content Type key? change its value from text/plain to text/javascript.
Finally chrome can breathe easy again.
I should note that neither Content Type nor PercievedType are there by default on Windows 7, so you could probably safely delete them both, but the minimum you need to do is that edit.
Anyway I hope this fixes it for you too!
I tried fixing this problem using this method but it didn't work for me.
My problem was that IIS manager didn't have MIME types in HTTP Features.
I was able to turn it on by enabling Static Context via...
--> Control Panel
--> Programs
--> Turn Windows features on or off
--> Internet Information Services
--> World Wide Web Services
--> Common HTTP features
--> [X] Static Content.
After this, MIME types appeared and everything started working again.
The accepted answer is a great one! However, just to post an answer for those who encounter problem like me, who use a department/college computer sometimes, where I do not have the permission to change any key value in regedit.
Change
<script type="text/javascript" src="main.js"></script>
to
<script src="main.js"></script>
Although the error message still exist, the page loaded correctly.
I've created a button whose function is to hide itself when clicked. But, it isn't working.Here's the code :
<html>
<body>
<button id="b">HIDE</button>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#b").click(function(){
$("#b").hide();
});
});
</script>
</body>
</head>
What's wrong with it?
That should work, but I'd strongly suggest you research the HTML for a valid document, i.e. </head> must appear before <body>.
Along with what alex said, it's possible that Chrome is blocking your request to the CDN-hosted jQuery. You can either give that domain valid permissions in manifest.json or simply download the copy of jQuery and store it locally.
If you are using SSL for your site, then you should serve your javascript/js file via https, else chrome will block it and causing your site's feature that is using that script not working.
I noticed that you are using http to call jquery from google cdn. May be it is causing that problem.