JavaScript how to use ace editor to make a html and css live preview make html editor javascript,make html editor

i am very new to coding so please be gentle. i have been given a project by a college that i am studying at. to build an online interactive tutorial, very much in the same vane as codecademy and the like. the problem is i do not have very much experience with javascript or jquery, as i have not been taught them yet. at the end of the project what they want is an online interactive tutorial with a live preview of the html and the css. the problem is i have no idea how to go about doing all this without any help this is why i am here.

i have been doing quite a bit of research and have found a couple of very good prospects for helping me to achieve this. they are ace editor and codemirror the problem is there are no tutorials that i can find to help me.

i have been able to get the html working with a live preview but not css. here is my jquery code.

//initializing ace editor
var htmleditor = ace.edit("htmleditor");
htmleditor.setTheme("ace/theme/twilight");
htmleditor.session.setMode("ace/mode/html");

var csseditor = ace.edit("csseditor");
csseditor.setTheme("ace/theme/twilight");
csseditor.session.setMode("ace/mode/css");
//html editor
function showHTML() {
    $('#return').html(htmleditor.getValue());
}

function showHTMLInIFrame() {
    $('#return').html("<iframe src=" + "data:text/html," + encodeURIComponent(htmleditor.getValue()) + "></iframe>");
}
htmleditor.on("input", showHTMLInIFrame);

//css editor
function showCss() {
    $('#return').css(csseditor.getValue());
}

function showCssInIFrame() {
    $('#return').css("<iframe src=" + "data:text/css," + encodeURIComponent(csseditor.getValue()) + "></iframe>");
}
csseditor.on("input", showCssInIFrame);

i have all the required js files attatched to my html. any help would be very much appreciated, even if you are just pointing me in the right direction. though if anyone can come up with a solution to the problem i am faced with, please let me know.

regards

Phil

Answer:1

text content of bootstrap modal body flows outside. when long text without any space. I need a solution.text content should not overlapping when text is long <script src="https://ajax....

text content of bootstrap modal body flows outside. when long text without any space. I need a solution.text content should not overlapping when text is long <script src="https://ajax....

  1. text content bootstrap
  2. text content center bootstrap
  3. carousel with text content bootstrap
  4. bootstrap text content scroll

what is the easiest way to retrieve form values to send to localStorage as a JSON string? I started a function with a for loop but am stuck..any nudges are greatly appreciated(still very new to this) ...

what is the easiest way to retrieve form values to send to localStorage as a JSON string? I started a function with a for loop but am stuck..any nudges are greatly appreciated(still very new to this) ...

  1. send html form data to email
  2. send html form to email
  3. send html form to google sheets
  4. send html form data to email using php
  5. send html form as json
  6. send html form data
  7. send html form to javascript function
  8. send html form data to email using javascript
  9. send html form to email javascript
  10. send html form data to database
  11. send html form data to node js
  12. send html form data to python script
  13. send html form data to rest api
  14. send html form data to python
  15. send html form data to excel
  16. send html form data to text file
  17. send html form data to another page
  18. send html form to email php
  19. send html form data to whatsapp
  20. send html form data to sql database

I'm trying not to mutate an object within an object before setting it to state like this: isDraggable = () => { let steps = [...this.state.stepsData]; steps = steps.map(step => ...

I'm trying not to mutate an object within an object before setting it to state like this: isDraggable = () => { let steps = [...this.state.stepsData]; steps = steps.map(step => ...

  1. vuex mutation nested object

I have a function that finds the longest word in a string. function findLongestWord(str) { var longest = str.split(' ').reduce((longestWord, currentWord) =>{ return currentWord.length > ...

I have a function that finds the longest word in a string. function findLongestWord(str) { var longest = str.split(' ').reduce((longestWord, currentWord) =>{ return currentWord.length > ...

  1. javascript reduce find max
  2. javascript reduce find min
  3. javascript reduce find
  4. javascript reduce to find average
  5. javascript array reduce find max
  6. javascript map filter reduce find
  7. javascript map find reduce
  8. js reduce find max