In Firefox work, but when load page in IE8 i get only blank page and source HTML-code available.
I delete
<script src="/NewsManager/js/jquery.js"
type = "text/javascript"
</script>
and all work without script.
NetBeans 6.7, ApacheTomcat, JSP
You missed the closing > in second line:
<script src="/NewsManager/js/jquery.js"
type = "text/javascript"> <!-- close the opening script tag HERE -->
Try this:
<script src="/NewsManager/js/jquery.js" type="text/javascript"></script>
Related
I have issue in my project in Eclipse.I have Dynamic Web Project which consists of jsp,html and javascript files in it.It displays html content for a fraction of second before loading actual html content with js and CSS ad ons. I couldn't find issue in the code.Is there anything I am missing?
This is the order in which I have included all my css and js files:
<html>
<head>
<style><%#include file="/WEB-INF/style.css"%></style>
<style><%#include file="/WEB-INF/jquery-ui.css"%></style>
<style><%#include file="/WEB-INF/jqueryui-com.css"%></style>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" integrity="sha256-KM512VNnjElC30ehFwehXjx1YCHPiQkOPmqnrWtpccM=" crossorigin="anonymous"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/file.js"></script>
</head>
I am trying to use React to render my UI in Play framework, but it doesn`t work. The same code just saved as .html file and opened directly can works normally, but if I place it in my play framework project as path: ./app/views/hello.scala.html, it just show title normally but nothing shown on my page. Here is my code:
<!DOCTYPE html>
<html>
<head>
<script src="./react/react.js"></script>
<script src="./react/react-dom.js"></script>
<script src="./react/browser.min.js"></script>
<title>React Title</title>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('example')
);
</script>
</body>
</html>
Please check weather all the js are loaded properly. check your assert path
<script src="assets/react/react.js"></script>
<script src="assets/react/react-dom.js"></script>
<script src="assets/react/browser.min.js"></script>
I am using jquery load function in my application's masterpage.html and it is working fine. But the problem is i need to put Jquery.min.js in all my content pages in order to use jquery functionality in my content page. I don't want to include it in all pages. It should refer from my master page.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
<script type="text/javascript">
function loadContent(pagename)
{
$("#output").load(pagename);
}
</script>
</head>
<body>
About
<div id="output"></div>
</body>
</html>
about.html
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
<div id="content">
This is about page !!
</div>
As you see my about.html again am including jquery in order to use it in my about.html page. How to avoid this in all pages ? Please help
No, it is not possible . You have to include it in all pages where you are using jquery
Instead of referring to the url like below ,
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
You can download the jquery library to your project path and use it like
<script src="project_name/folder_name/jquery.min.js">
But it is compulsory to include jquery in all pages
Hope this helps !!
I can't give you a best answer, these is my advice
the jQuery file had better include at the bottom in body tag.
If you use the jQuery,you must include it.
I'm using eclipse as my java IDE and the project I'm working on uses struts. Eclipse is telling me on any page that has struts tags that the tags are syntax errors.
E.g. my tag <logic:equal shows this error
Syntax error on token "<", delete this token
but the page works just fine. How can I get eclipse to not show errors in these cases?
EDIT: Just noticed this is only when the tag is inside a <script> block. Tags in regular HTML work fine. Is this just an unresolved bug with my version of eclipse?
EDIT 2: posting a code block per the comment. Also added the CDATA to the file like the response suggests. I'm still getting the error in eclipse.
<script type="text/javascript" language="Javascript1.2">
//<![CDATA[
window.onload = function ()
{
<logic:equal value="false" name="BeanKey" property="value(RecordNotFound)">
alert("Record not found");
</logic:equal>
}
//]]>
</script>
Instead you can try like this,
<logic:present name="BeanKey" property="value(RecordNotFound)">
<logic:equal value="false" name="BeanKey" property="value(RecordNotFound)">
<script>
window.onload = function ()
{
alert("Record not found");
}
</script>
</logic:equal>
</logic:present>
Enclose your JavaScript into a CDATA block:
<script type="text/javascript">
<![CDATA[
var javascript;
]]>
<script>
I have one problem with Firefox 12 (newer Firefox works well, and another browsers works well too).
In Firefox 12 MyApplet is undefined.
In another browsers everything works well.
In newer Firefox everything works well too.
but I need to fix this in firefox 12 too.
....
....
<html>
<head>
<script type="text/javascript">
function callbackFunction() {
....
MyApplet.getData();
// My applet is undefined in firefox 12.
....
}
</script>
</head>
<body >
<script src="https://www.java.com/js/deployJava.js"></script>
<script >
var javaVersion='1.6';
var startApplet = function(){
var attributes = {
id: 'MyApplet', scriptable: 'true',
code:'X.Y.Z.MyApplet.class',
archive:'<%=request.getContextPath()%>/applets/MyApplet.jar'
};
var parameters = {
challenge : "${serverChallenge}",
callbackFunction : 'callbackFunction()',
language: "${pageContext.response.locale.language}"
};
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
}
startApplet();
</script>
</body>
</html>
is it possible, to solve that problem using JS or something like that?
that's solution: updating Firefox;