Why this link doesn`t work?
//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Description" content=" [wstaw tu opis strony] ">
<meta name="Keywords" content=" [wstaw tu slowa kluczowe] ">
<meta name="Author" content=" [dane autora] ">
<title>[tytuł strony] </title>
<link rel="stylesheet" href="style.css" type="text/css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".animat_kon").click(function () {
$(".animat_text").slideToggle("slow");
});
});
</script>
</head>
error example:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
you did not included http://
whenever you are downloading from the server directly then usehttp://
Change
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
into
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
You missed the http:. You can skip the http: to let your browser automatically choose between HTTPS and HTTP. But in your case the debugging tool seems not to understand this syntax.
Find more information here: Can I change all my http:// links to just //?
The link must start with http://
Please change your script src to:
<link rel="stylesheet" href="style.css" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
script src should start with http://
Related
Can anyone please help me to understand why I'm not able to append the HTML head to index.htm from an external file(header.htm)?
I'm using the following codes:
Index.htm:
<!DOCTYPE html>
<html lang="en">
<head id="head">
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
</head>
<script>
//window.location.replace('./Components/header.htm');
$.get("./Components/header.htm", function(data) {
//alert(1);
$("head").append(data);
});
</script>
</html>
header.htm:
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SAM Store</title>
<link rel="icon" href="./Static/Final-JPEG.jpg">
I'm able to successfully redirect from index.htm to header.htm
I have a test.aspx page.
The html code is
<script type='text/javascript' language='javascript' src="scripts/test.js"></script>
<script type="text/javascript" language='javascript' src="scripts/abc.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>"test Application"</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
</head> ...
But when I am executing this page, it is throwing the following error.
can't execute code from a freed script.
When I search in google, I got the answer as Meta tag should be after script tag.
Is it recommended to put script tags after meta tag in .aspx page.
The correct syntax is
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>"test Application"</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<script type='text/javascript' language='javascript' src="scripts/test.js"></script>
<script type="text/javascript" language='javascript' src="scripts/abc.js"></script>
</head>
<body>
</body>
</html>
Or You can put the script tag inside the body after the closing of form tag.
You should do some reading on basic HTML structure http://www.w3schools.com/html/
Your script tags need to be inside the <HTML> element. Ideally at the end of the body tag...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>test Application</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
</head>
<body>
<form id="myForm" runat="server">
<!-- you html elements -->
</form>
<script type='text/javascript' language='javascript' src="scripts/test.js"></script>
<script type="text/javascript" language='javascript' src="scripts/abc.js"></script>
</body>
</html>
The doctype is important to get the page to render in standards mode. However with the (almost) release of HTML5 you should be using it as it provides many more elements to take advantage of. Example below..
<!doctype html>
<html lang="en">
<head runat="server">
<title>test Application</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
</head>
<body>
<form id="myForm" runat="server">
<!-- you html elements -->
</form>
<script src="scripts/test.js"></script>
<script src="scripts/abc.js"></script>
</body>
</html>
meta script title should be inside the head tag. You can also load the scripts in the end of the body to increase page loading performance.
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type='text/javascript' language='javascript' src="scripts/test.js"></script>
<script type="text/javascript" language='javascript' src="scripts/abc.js"></script>
<title>"test Application"</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
</head>
<body>
</body>
</html>
I've tried many different places for the script with $('#editable').jqte(); inside.
Sometimes the editor shows up, sometime it does not, it seems non-deterministic.
It's like my document is not ready when I call the jqte() function.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Parcours, technique, sujets, peinture figurative, couleurs, émotion." />
<title>Creating Page</title>
<link href="/bundles/usersite/css/homepage.css" type="text/css" rel="stylesheet" />
<script src="/bundles/usersite/js/jquery.js" type="text/javascript"></script>
<link href="/bundles/usersite/css/jquery-te.css" type="text/css" rel="stylesheet" />
<script>
$(document).ready
(
function()
{
$('#editable').jqte();
}
);
</script>
</head>
<body class="oneColFixCtrHdr">
<div id="container">
<div id="mainContent">
<div id="editable">
</div>
</div>
</div>
</body>
</html>
EDIT:
Due to my twig template the below is missing in some cases (like the above one):
<script src="{{ asset('bundles/usersite/js/jquery-te.js') }}" type="text/javascript"></script>
works better with javascript linked !!!!!!
The main html file contains following javascript source
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Hello Worlds</title>
<link rel="stylesheet" href="css/main_page.css" type="text/css"/>
<link rel="stylesheet" href="css/page_content.css" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/main_page.js"></script>
<script type="text/javascript" src="js/page_content.js"></script>
<script type="text/javascript" src="js/configurator.js"></script>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
one of the form's post called a javascript function which belongs to page_content.js file.
I am trying to inovke the function using following
$scripter->get('javascript:submitForm()');
but it's not working. Please help me how can I call the function which belongs to the page_content.js file.
If the html page (with address stored in $url) contains (internally or externally) JavaScript that define function/procedure submitForm() then you can execute it by the following code:
use WWW::Scripter;
$w = new WWW::Scripter;
$w->use_plugin('JavaScript');
$w->get($url);
$w->eval('submitForm();');
For more information see WWW::Scripter documentation.
I've been futzing with this for hours trying to figure out why codemirror.js won't load in any browser other than Firefox. Any ideas?
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title></title>
<script src="CodeMirror/js/codemirror.js"></script>
<link href="Styles/Style.css" rel="stylesheet" type="text/css" />
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function () { $('#container-1').tabs(); });
</script>
<style type="text/css"> /* (some css) */ </style>
</head><body>
<!-- (some stuff) -->
</body></html>
CodeMirror/js/codemirror.js
alert("LOL");
I tried the code in Firefox 3.6.3, Internet Explorer 8, Opera 10.53 and Safari 4.0.5, and it works just fine.
Note that the address to the script is relative, so if your page is at www.mydomain.com/content/pages/page.html, it will load the script from www.mydomain.com/content/pages/CodeMirror/js/codemirror.js, not www.mydomain.com/CodeMirror/js/codemirror.js.
One thing that you can improve is to add the type attribute to the tag:
<script src="CodeMirror/js/codemirror.js" type="text/javascript"></script>