How to put .map file in HTML document? - javascript

I want to put some Bootstrap code in website, I found some scripts, in file there are files with .map extension. I don't know how to upload them in HTML document. We connect CSS file from HTML file with following tag:
<link rel="stylesheet" type="text/css" href="/wp-content/themes/heatmap-adaptive.1.5.3/style.css"/>
and so, how can do some job with .map?
There are files with such names: bootstrap-theme.min.css.map

Those are source map files, they are used for debugging the CSS code after it has been minified. The browser reads them automatically if the source maps feature has been enabled in its dev tools and they are available in the same directory as the minified CSS file they point to.
So the answer is: you don't put them in the document.

Related

Flask Application not returning javascript contents in html

I have a little problem here with my flask application
i have this html file that i have linked to some javascript files and if i open the html file with a browser it works fine with the javascript codes.
Now if i use python flask and return the html file,only the html file is popped up while the JS part is not reflecting on the Web page?
I have linked my JS files to the html page and they are in the same folder
any solutions?
head>
<script src="jquery-1.11.3.min.js"></script>
<script src="video.js"></script>
<script src="zxing.js"></script>
</head>
You should create a new folder titled "Static". Inside that folder is where you store all your CSS files, JavaScript files, etc. So move your video.js, zxing.js and any other JavaScript file to the "Static" folder. Hope this helps, feel free to ask any questions!

Script tag source defaults to URL over path

I'm trying to make a chat application using socket.io and Node.JS. In my html file called index.html, I am trying to use a script tag to point to a script file called bundle.js that contains a browserified set of variables and functions.
The problem is, despite referencing the proper path in my src attribute, the tag seems to include a bundle.js within my localhost:3000.
Oddly enough, when viewing this bundle.js with developer tools, the content seems to be identical to that of my index.html file. This creates a syntax error as the JavaScript file contains html syntax from my html file. Any ideas why this might be?
<script src="bundle.js" type="text/javascript"></script>
This is how the script tag appears in my html file.
This is a link to a screenshot of my developer tools (New here so not enough rep to post the actual pic)
As we can see bundle.js is open in developer tools is Html code, not js that's why error is shown in first line, or there is something wrong in webpack configuration.

how to load script file available in one folder up than the loading html file

I am kind of new to web development..so not sure if this is possible,
I am trying to load a script file from HTML file. Script file is available one folder up than the html
/test/myScript.js
/test/test123/MyPage.html
I am trying to load myscript.js file using following..but its not working. let me know how to proceed further on this.
<script src="../test/myScript.js" type="text/javascript"></script>
I have an emtpy web project from visual studio, this html file is added there. when i run the solution this file start on IISExpress
You need to remove test from the path.
Try this.
<script src="../myScript.js" type="text/javascript"></script>
Make sure script file is also added to visual studio project.
HINT : You can also drag script file to the HTML editor in visual studio. It would have created script tag with path for you. Not sure which visual studio you are using but almost all VS support this.

Using less.js gives exception

When I try to include less.js it gives me a XmlHttpRequest Exception 101.
I include the .less file like this:
<link rel="stylesheet/less" type="text/css" href="anything.less" />
Now, I'm working on a Tumblr theme, and this ONLY happens when I upload the theme to Tumblr.
Both files are included correctly, I can reach the real files by clicking the links in the source code.
Can anyone help me with this one?
I used this for production only. It's very time consuming to compile the less file locally, embed it into the template and then upload it again.
Not a duplicate of:
LESS CSS minimal setup failure
I'm using Safari, and I'm using a global url (http://somelink.com/style.less).
You said:
The html file is then on www.tumblr.com, and the .less file is on
themelandia.com
This means that less.js file must make a cross domain ajax request in order to retrieve your .less file. Browsers do not allow this, and thus the request fails.
If you want to fix your problem, you must put the .less file somewhere on tumblr.com

Local CSS and JS files not linking to html pages

I have a base html file which I want all other pages to inherit certain charateristics from. But although my inherited pages eg. main.html can reference external links eg:
<link href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.css" rel="stylesheet">
With no problem. But when I try to download the twitter bootstrap and store the file in the same directory as all the other html pages it cannot link to that file and it gives me a 404 error. My file structure is simple; a folder called templates with all the html, css and js files in this directory.
So i'm doing this:
<link href="bootstrap.css" rel="stylesheet" media="screen">
When I try to do this:
<link href="http://localhost/templates/bootstrap.css" rel="stylesheet" media="screen">
I get no 404 error, but from the view source on the web page, if I try to access that page I get an error saying:
Firefox can't establish a connection to the server at .
I'm really lost to why this 'simple' thing is not working.
Do you have a base tag inside your html? If so, it could be saying firefox a specific host where to find files, different than localhost.
Try use Firebug on Firefox or Chrome developer tools to see which URLs it's trying to retrieve.

Categories

Resources