Intellij idea code completion for w3.css framework? - javascript

I'm using w3.css framework from https://www.w3schools.com/w3css/default.asp which is an alternative to Bootstrap.
IntelliJ idea does not show up code completion for this framework.
Does anyone know how to set it up in IntelliJ idea?
I did add the link to the head of page also but still no result.
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<title>W3.CSS framework</title>
</head>

Did you try downloading the library locally per instructions in https://www.jetbrains.com/help/webstorm/2021.3/style-sheets.html#ws_html_code_completion?
Once you do this, completion should be there:

Related

Page is shown on DOM but can't be crawled

I don't have a direct access to the code itself right now, But I've got some client whose website was developed in angularjs, and all the code gives an output on the DOM (I can see the pages with all the elements and everything is loaded just fine), but when I tried to make a crawling test via Google - it looked like the website wasn't scanned yet, even though it's been already a month.. and then I saw something weird - that when I 'view source' the pages themselves, all I get is this piece of code -
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="ahrefs-site-verification" content="xxxyyy">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#1976d2">
<link rel="stylesheet" href="styles.32f34f185b7564580e93.css"></head>
<body>
<app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
<script type="text/javascript" src="runtime.34e0ced836cdde276d53.js"></script><script type="text/javascript" src="polyfills.700c13e3feb6da6eca5f.js"></script><script type="text/javascript" src="main.e89588fe3aa7c32000ef.js"></script></body>
<script src="https://wchat.freshchat.com/js/widget.js" async=""></script>
</html>
I guess the problem is happening in these lines -
<app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
Do you have at least any speculation why this might happen?
Since you're dealing with a SPA, SEO is not that straightforward. Google crawls your index.html which contains the app-root of your Angular app and my experience is that it will not execute the JS which contains your SPA routes. Your only options for optimizing SEO in SPA's is prerendering your routes, through an external service like Prerender.io or create your own prerender or use a Server Side Rendering technology for your SPA.
Since you are using Angular you should take a look at Angular Universal.
edit: if you don't want the complete hassle of prerendering all your routes but just want an acceptable result in Google for your index.html at least set a proper title tag <title>Proper Title - Wonderful website</title> and the meta description tag <meta name="description" content="Description of max 160 chars">
You might try Inspect Element instead of View Source
I don't know whether the project has been deployed in dev mode or production mode but doing an Inspect element will help you to access the DOM elements.
You can check this article to understand the difference between view source and Inspect Element

CSS and semantic ui cdn does not work in localhost

My html structure is like below, and the folder path is correct:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Application</title>
<link rel="stylesheet" type="text/css" href="../app/assets/appStyle.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.css">
<link rel="text/javascript" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.js">
</head>
When I try the pages from the browser, they work. However, when I try them from localhost, it does not load css or the minified semantic ui. Could anybody help please? I have been struggling with this for 3 hours. Any help or hint is appreciated.
EDITED: I have a function like below, for routing in my app.js file. Can it be a reason?
// Make the user route to application.html
app.get('*',function(req,res){
res.sendFile(path.join(__dirname + '/public/pages/application.html'));
});
I think problem is here
<link rel="stylesheet" type="text/css" href="../app/assets/appStyle.css">
If you want to check that stylesheet is working properly, right click
the browser and click View page source.
Click the stylesheet link and check is it load the stylesheet
correctly.
If it is not working properly check your path and correct that.
You are using <link> tag for Javascript. <link> tag is not supported by browsers to load JS.
Please refer to this StackOverflow question: Can I load javascript code using <link> tag?.
<link rel="text/javascript" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.js">
Use script tag to load JS.Try replacing above lines with:
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.js"></script>
Let me know if this works.

Angular with IBM carbon design

I am trying to user carbon component in my angular application.
I included the given scss "../node_modules/carbon-components/scss/globals/scss/styles.scss" in my angular-cli file.
Now I am trying to use Modal in my component class as suggest here. but it's not working.I am unable to use Modal custom event in angular component file.
I am stucked from 2 days now I am reading library. If anyone have experience of Carbon Component.Please suggest...
You can provide CDN links in your index.html
CSS https://unpkg.com/carbon-components/css/carbon-components.min.css
ES5 https://unpkg.com/carbon-components/scripts/carbon-components.min.js
as shown here.
example:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SignupFormProject</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href=" https://unpkg.com/carbon-components/css/carbon-components.min.css">
</head>
<body>
<script src="https://unpkg.com/carbon-components/scripts/carbon-components.min.js"></script>
<app-root></app-root>
</body>
</html>

Trying to link JQuery Mobile into html. Works when using a hosted version, but not local

I've been having issue linking in the JQuery api into my html page. I've spent a lot of time trying to figure it out myself, but haven't made any progress, and would really appreciate anyone's help! Like I mentioned in the title, it works fine when I link to a hosted version of JQuery, but when I try to use a local version, I have no success (I need to work locally for what I'm using it for). Side Note: I downloaded the files directly from JQuery's site, and put them in the root folder for simplicity.
Please see the code below...
This does not work properly:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="jquery.mobile-1.4.5.min.css"/>
<script type="text/javascript" src="jquery.mobile-1.4.5.min.js"></script>
<script type="text/javascript" src="jquery-2.2.3.js"></script>
</head>
<body>
</body>
But this does work properly:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
</body>
Maybe it's the order the scripts are coming in - your working version has jQuery first, then mobile, while the non-working one has the opposite. If that doesn't fix it, double-check that your file paths are all correct - the way it's written, your html file must be in the same folder as the scripts. If it's not, try prepending a slash: <script src="/jquery-2.2.3.js"> to force it to look at the root folder.
One way to confirm whether that's the issue is to check your browser dev tools. If you're in chrome, right click -> inspect element, and find the Network tab. Reload your page while you've got that open and see if your page is successfully loading the scripts. If you see the names of those scripts in red, it means they weren't found or couldn't be loaded.
Last thought: if you're working on your local site via opening a file:// path, the JS you can use will be restricted; this is a security feature. To get around it, run your site on a local server. Mac OS X has a built-in one, or you can use PHP or python to get one up and running immediately from the command line, or install a library like pow or serve. Google around for 'local web server setup', there are tons of options.

Beaglebone Local jQuery Files not Loading

I'm working on a wireless robotics project utilizing node.js and jquery to create a webpage "controller".
Currently, my code is as below, however its functionality is limited to working with an internet connection due to the downloading of the scripts through the internet addresses. My goal is to allow this to function without internet connectivity
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- jQuery and jQuery Mobile -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
In order to try to save these files to the beaglebone locally, I created 3 files: Source1.css Source2.js and Source3.js which are copied and pasted into their respective files from the HTML links in the code above and stored in the same directory as the html and javascript files used for the server.
I have edited the code to appear as below
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- jQuery and jQuery Mobile -->
<link rel="stylesheet" href="Source1.css" />
<script src="Source2.js"></script>
<script src="Source3.js"></script>
<script src="/socket.io/socket.io.js"></script>
However when I attempt to start the server using the node command, only the HTML appears to load in the webpage. I have attempted changing the charset and including the entire path to the jquery source files with no success. Any help would be greatly appreciated!
Disconnect from the Internet. Press Ctrl+Shift+I in the Chrome browser to load developer tools, change to the "Network" tab then press F5 to refresh the page. You will see the resources your page loaded (and some it attempted to load). Sort these results by the Initiator column. You will likely find Socket.IO initiated dependencies that failed to load.

Categories

Resources