I 'd like to understand how the following piece of code works
<!DOCTYPE html>
<head>
<title>Title</Title>
</head>
<body>
<form method="POST" action="/link" >
<div id="form1" >
<input type="file" class = "btn btn-danger">
<img id="pic" src="#" alt="HTML5 Icon" >
</div>
<input type="submit" name="submit" value="Submit" class = "btn btn-info">
</form>
</body>
</html>
I am trying to render images when using a file upload handler and apparently at this point the code breaks. It seems to have the effect of reloading the page again and again.
The question is similar to one already asked in stackoverflow.
[<img src="#"> Means in HTML?
I think that the "#" attribute was calling the url again and set up a sort of infinte loop that was resulting in the multiple post requests to the server.
Anyways, got the code to work by using a default image filename instead of the "#"
Related
I'm trying to use the jquery css stylesheet, but I can't seem to get it to format anything at all. I'm using the live preview extension in VSCode, and the css is from the jquery website.
<!DOCTYPE html>
<html>
<head>
<title>Physics Simulator App</title>
<link rel="stylesheet" href="css\jquery.mobile-1.4.5.min.css">
<script src="scripts\jquery-3.5.1.min.js"> </script>
<script src="scripts\jquery.mobile-1.4.5.min.js"> </script>
<script type='text/javascript' src='scripts\Week 2 homework.js'> </script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div data-role="page">
<div data-role="navbar">
<ul>
<li> Information </li>
<li> Interface </li>
</ul>
</div>
<div data-role="header">Binary Operators Demo</div>
<div data-role="content">
<label for="input">A</label>
<input type="checkbox" name="inputA" id="inputA">
<br />
<label for="input">B</label>
<input type="checkbox" name="inputB" id="inputB">
<br />
<button onclick="AND();">AND</button>
<button onclick="OR();">OR</button>
<button onclick="NOT();">NOT</button>
<button onclick="XOR();">XOR</button>
</div>
<table id="data">
<tr>
<td>Result: </td>
<td id="resultA"></td>
</tr>
</table>
<div data-role="footer">
<small>binary operations demo app</small>
</div>
</div>
</body>
</html>
I don't think I'm missing anything in terms of brackets, and the file paths work for my own css files. I've tried adding 'data-theme="a"' to my page bracket, but nada. I just get this.
result
Is it a version issue or?
Friend, I may have misunderstood you for not mastering English very well. But as I understand it, your problem is with jquery.mobile.css?
Try using the CDN. I copied your code and replaced the with the CDN (I didn't find this Week 2 homework.js).
Replace the with the CDN and do this test:
Insert this code block:
<div class = "ui-grid-d">
<div class = "ui-block-a">
button <br>
<span> any info </span>
</div>
</div>
It uses the style of jquery.mobile.css, if it works the problem could be in your import of the files.
Two tips, avoid spaces in the file names, (Week 2, it could be Week_2_homework), and in the <label for = ""> do not point "input", point the name you gave to the input or the id.
If I was wrong about your problem, answer that I try to help you.
Reggards
I know that the code below will go to the result page of google when the user types some texts and the submit button is clicked.
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Hello!
</title>
</head>
<body>
<form action="https://www.google.com/search" method="get">
<input name="q" type="text">
<input type="submit" value="Submit Form">
</form>
</body>
</html>
But I try this with https://www.jitta.com/. It does not seem to have the same structure as google.
When searching on this website the url will be https://www.jitta.com/stock/bkk:ptt where "ptt" is the word that I want to search. Unlike google, if I want to search "ptt" the url will be https://www.google.com/search?q=ptt.
Can it be only HTML code? no other parts involved (like Javascript,...)
Appreciate anyone who answers this.
How would you do this with form ()?
Make a text box and a Submit button.
You type anything in the textbox and Submit will open a website in your browser with a link of: (example) test.com/TextTheyPutHere.
Basically, if I put 'lol' in the textbox, it would open a website test.com/lol.
Please help.
Try this:
<!DOCTYPE html>
<html>
<head>
<script>
function newDoc() {
window.location.assign("http://www.yourVeryOwnSitez.com/"+document.myForm.myDestination.value)
}
</script>
</head>
<body>
<form method="post" name="myForm">
<input type="text" name="myDestination">
<input type="button" value="Gogogo" onclick="newDoc()">
</form>
</body>
</html>
Then edit line 7 and put your particular url in the place of "www.yourVeryOwnSitez.com".
I try put meta in myhtml code
for example I want do it for my search engine with offical google code:
<div itemscope itemtype="http://schema.org/WebSite">
<meta itemprop="url" content="https://www.example.com/"/>
<form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction">
<meta itemprop="target" content="https://query.example.com/search?q={search_term_string}"/>
<input itemprop="query-input" type="text" name="search_term_string" required/>
<input type="submit"/>
</form>
</div>
THis is my problem.
The local search engine in my website use root url...
for example http://example.com/obama
but the code done it something like this when I submit it:
http://example.com/?search_term_string=obama
how can remove '?search_term_string=' without bad effect on the code?
I have an HTML webpage with a specialized purpose. However, I also have a HTML page with a generic set of actions used elsewhere in my site/app.
Specific Page
<html>
<head><title>Specific Page</title></head>
<body>
<h1>My Specific Action</h1>
<div id="NameAction">
<!-- Action HTML goes here... -->
</div>
</body>
</html>
Generic Action
<html>
<body>
Please tell me your name...
<input id="NameText" type="text" size="50" />
<input id="NameSubmit" type="submit" />
</body>
</html>
The question is, I would like to inject the Generic Action HTML into the NameAction div in the Specific Page. What are some ways I would go about doing this?
Use an iframe
<html>
<head><title>Specific Page</title></head>
<body>
<h1>My Specific Action</h1>
<div id="NameAction">
<iframe src="Path-to-generic-html" />
</div>
</body>
</html>
You could use an iframe, which is a way to embed one html document into another, however this makes it difficult for the two html fragments to interact on the front end (Javascript, etc.). Depending on what templating engine you're using (jsp, php, asp) you should be able to include html fragment into a page as follows (server side include):
Generic Action Fragment
Please tell me your name...
<input id="NameText" type="text" size="50" />
<input id="NameSubmit" type="submit" />
Specific Page
<html>
<head><title>Specific Page</title></head>
<body>
<h1>My Specific Action</h1>
<div id="NameAction">
<% include generic action fragment here using engine specific code %>
</div>
</body>
</html>