Kurt Miller Kurt Miller - 6 months ago 29
HTML Question

Jquery Mobile CDN alternative

I'm tryna use Jquery MObile. So instead of using CDN, I've used the folloging code in my html page

<head>
<link rel="stylesheet" href="JqueryFiles\jquery.mobile-1.4.5.min.css">
<script src="JqueryFiles\jquery.mobile-1.4.5.min.js"></script>
<script src="JqueryFiles\jquery.js"></script>
</head>


It does not seems to work. Jquery, Jquery Mobile or even the css file are not rendred in my web page.

<!DOCTYPE html>

<html>

<head>
<link rel="stylesheet" href="JqueryFiles\jquery.mobile-1.4.5.min.css">
<script src="JqueryFiles\jquery.mobile-1.4.5.min.js"></script>
<script src="JqueryFiles\jquery.js"></script>
</head>

<body>

<div data-role="page">

<div data-role="header">
<h1>FIRST PAGE</h1>
</div>

<div data-role="main" class="ui-content">
<h1>HELLO WORLD</h1>
<p>Welcome </p>
</div>

<div data-role="footer">
<h2>&copy; Test</h2>
</div>

</div>

</body>

</html>


Do you guyyz know why it's not working ? (from what I've understood so far there should be some styling on the header and the footer. But this is not working here

PS: I've tried with CDN and it works with CDN BUT I dont want to use CDN as I'm coding for a local application only

ScreenShot ofmy JqueryFolder
enter image description here

Console Error ScreenShot
enter image description here

Answer

This appears to be because you are using forward slashes "\" instead of backslashes "/"

This:

<head>
    <link rel="stylesheet" href="JqueryFiles\jquery.mobile-1.4.5.min.css">
    <script src="JqueryFiles\jquery.mobile-1.4.5.min.js"></script>
    <script src="JqueryFiles\jquery.js"></script>
</head>

should be this:

<head>
    <link rel="stylesheet" href="JqueryFiles/jquery.mobile-1.4.5.min.css">
    <script src="JqueryFiles/jquery.mobile-1.4.5.min.js"></script>
    <script src="JqueryFiles/jquery.js"></script>
</head>
Comments