Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
In a page of my web, I have a textarea to write html code. How to show this html result of this textarea into a other view under this texterea.
You are looking for a WYSIWYG for angular:
Angular WYSIWYG directive
textangular
angular-redactor
angular-froala
List provided here as well: http://ngmodules.org/tags/wysiwyg
<html>
<head>
<meta name="description" content="quick edit panel" />
<meta name="viewport" content="width=device-width">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
</head>
<body>
<div class="prompt" contentEditable=true
style="padding:5px;
background-color:black;
height:28px;
color:white;
font-family:'courier new'">
write a html code <span style="background-color:blue;">here</span>
</div>
<div class="result">
write a html code <span style="background-color:blue;">here</span>
</div>
<script type="text/javascript">
$('.prompt').focus();
$('.prompt').keypress(function(event){
if ( event.which == 13 ) {
var resultado = $('.prompt').html();
console.log(resultado);
$('.result').append($('<div/>').html(resultado).text()+"<br>");
$('.prompt').html('');
$('.prompt').focus();
}
});
</script>
</body>
</html>
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 days ago.
Improve this question
What is the most beginner way to put some little changes into an HTML page?
For example, we need to choose between "./textC.js" and "./imgC.js" files, both having function countCows() {} of different algorithms.
I've spent lots of time browsing through "changing script src dynamically" articles, but location.reload() reloads the whole page (or a <div>, I haven't found the pattern yet), some things don't work at all, some answers use complicated high software technologies I have never seen before.
This be the template html page:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Template page</title>
<link id="sizescheme" rel="stylesheet" type="text/css" href="./texty.css" media="screen"/>
</head>
<body class="custombackground">
<div id="commonblock">
<button id="coucow" onclick="countCows()">Count the cows</button>
<div id="countResult"></div>
</div>
<div id="textOnly">
Something that has nothing to do with images
</div>
<script id="counter" src="./textC.js"></script>
</body>
</html>
The caller HTML page has something like this:
<div id="initial-things" >
<button id="txb" onclick="setType("t")"> Text </button><br />
<button id="imb" onclick="setType("i")"> Image </button>
</div>
And could have done this if it were the same page as the template (but scripts do not load dynamically, see the first paragraph):
<script>
function setType(param) {
if (param == "i") {
document.getElementById("sizescheme").href = "./imgy.css";
document.getElementById("counter").href = "./imgC.js";
document.getElementById("textOnly").style.visibility = "collapse";
}
if (param == "t") {
document.getElementById("sizescheme").href = "./texty.css";
document.getElementById("counter").href = "./textC.js";
}
}
</script>
So, how does one create a page from a template?
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
Please I'm trying to knockoff a loading bar on my site, I have searched through the files, still can't find it. I also tried inspecting using google chrome, but I couldn't target the loader. Kindly help out
Click here for to visit website.
<div class="pace pace-inactive">
<div class="pace-progress" style="width: 100%;" data-progress-text="100%" data-progress="99">
<div class="pace-progress-inner"></div>
</div>
<div class="pace-activity"></div>
</div>
Remove this html construct. There also should be a javascript/css which triggers the loading bar. You can remove that too.
It's inside your head:
<script src="assets/plugins/pace/pace.min.js"></script>
<link href="assets/plugins/pace/pace.css" rel="stylesheet">
just go the HTML of your page. there from the top, search for <body> tag. Just below it you'll find this :
<div class="pace pace-inactive"><div class="pace-progress" data-progress-text="100%" data-progress="99" style="width: 100%;">
<div class="pace-progress-inner"></div>
</div>
<div class="pace-activity"></div></div>
Remove all these lines and you'll be fine
and remove these two lines in your <head> tag
<link href="assets/plugins/pace/pace.css" rel="stylesheet">
<script src="assets/plugins/pace/pace.min.js"></script>
Remove Pace library/plugin from your index.html in head section
& from assets folder inside your application.
<link href="assets/plugins/pace/pace.css" rel="stylesheet">
<script src="assets/plugins/pace/pace.min.js"></script>
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
This following code do nothing .When i click button it should tell my how many guess computer has taken to find my given input. I am using Adobe Dreamweaver.What might be wrong ?
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p> How many finger ? </p>
<p><input id="myNum" type="text"</p>
<button id="guess"> Mafia </button>
<script type="text/javascript">
document.getElementById('guess').onclick=function(){
var myNumber=document.getElementById('myNum').value;
var GotIt=False;
var NumOfGuess=0;
while(GotIt==False)
{
var guess=Math.random();
guess=guess*6;
guess=Math.floor(guess);
if(guess==myNumber)
{
GotIt==True;
alert("Got It");
alert("You took"+ NumOfGuess +"guess");
}
else
{
NumOfGuess+=1;
}
}
}
</script>
</body>
</html>
Plea check your browser console, you could see that you've some typo's like False/True they should be in lowercase format false/true, e.g:
var GotIt=False;
while(GotIt==Flase){
}
That should be :
var GotIt=false;
while(GotIt==false){
}
Hope this helps.
There is a typo. Replace Flase by false. You should also use === instead of == in your code, but that's secondary.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
You know, the 8 small iframes that show your most visited websites. How do they get the snapshots of the websites? How do they decide which websites to use? Just how do they work.
Edit: So that I can do something similar.
Edit 2: Is this not programming? I'm asking how to code an iframe that takes a snapshot of a websites.
By using an internal method that shows the picture (in this particular case; chrome-search://thumb/53/22) ? Did you take a look at the source?
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="common.css">
<link rel="stylesheet" href="thumbnail.css">
<script src="util.js"></script>
<script src="thumbnail.js"></script>
</head>
<body dir="ltr">
<a href="http://www.reddit.com/" ping="/log.html?pos=1" title="reddit: the front page of the internet" target="_top" tabindex="-1" style="color: rgb(119, 119, 119); font-size: 11px; font-family: arial, sans-serif;">
<span class="shadow"></span>
<!-- RIGHT HERE! -->
<img src="chrome-search://thumb/53/22">
</a>
</body>
</html>
Have a look at chrome-search://most-visited/thumbnail.js:
function createThumbnail(src) {...} // creates the thumbnails
you can try to remove the contents of
function showDomainElement() {}
if you don't want to see those in new tab page. I haven't tried this.
These snapshots are generated by internal layout engine. But, you can do it with some classes, like html2image, DOMPDF, etc.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I have a html page with a button whos onclick calls a javascript function...but I have been getting a function not defined error for two days! Can someone help?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/jquery.mobile-1.2.1.css" />
<link rel="stylesheet" href="css/jqm-docs.css"/>
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jqm-docs.js"></script>
<script src="js/jquery.mobile-1.2.1.js"></script>
<script>
function doSomething(){
alert('this is a test');
}
</script>
</head>
<body>
<div data-role="dialog">
<div data-role="content" id = "test" data-theme="c">
$confirm
Cancel
</div>
</div>
</body>
</html>
This might be handy:
http://jquerymobile.com/demos/1.2.0/docs/pages/page-scripting.html
You need to stick your scripts within the page element:
<div data-role="page">
<script>
function doSomething(){
alert('this is a test');
}
</script>
<!-- the rest of your stuff -->
</div>
In fact i have passed personally with this error even with valide HTML all what you need to do is move all of your functions to the head element.
Here is a fiddle:
http://jsfiddle.net/WekEA/1/
To demonstate what i have said in the framework & change the NoWrapToHead to onload