score:0
You need to Use Ajax
. i think this must help you to solve your issues.
Follow tutorial of ajax on
score:0
You will be using Ajax.
Make the textarea post to where you want the other pages to load from (database or flat file).
Have the other pages run a javascript loop that waits a few seconds then loads the contents of the file via ajax then displays it in the area you want it.
It's not too hard with jquery
score:0
I'm going to disagree with the answers below. If you do an AJAX call it should be once and it should get you a definition list of what conversions to perform. The actual conversions should be done on the client side, otherwise you're going to end up sending a request to the server with every keypress!
Here's an example of how you could do it:
// The array of regex patterns to look for
$format_search = [
/\[b\](.*?)\[\/b\]/ig,
/\[i\](.*?)\[\/i\]/ig,
/\[u\](.*?)\[\/u\]/ig
]; // note: NO comma after the last entry
// The matching array of strings to replace matches with
$format_replace = [
'<strong>$1</strong>',
'<em>$1</em>',
'<span style="text-decoration: underline;">$1</span>'
];
$('textarea').on('keyup', function() {
var preview = $(this).val().trim();
// Perform the actual conversion
for (var i = 0; i < $format_search.length; i++) {
preview = preview.replace($format_search[i], $format_replace[i]);
}
// show the preview in your div
$('#preview').html(preview);
});
Here's a demo fiddle. The replacement code is used from this answer.
My suggestion is that if you're going to use AJAX, use it to get the definitions for $format_search
and $format_replace
from a datasource rather than using it to parse the replacements.
score:0
Try this code:
<!DOCTYPE html>
<html>
<head>
<script src="jquery.js"></script>
<script>
function myFunction(x)
{
var text = x.value;
$('#preview').show();
document.getElementById('preview').innerHTML=text;
}
</script>
</head>
<body>
<div id="preview" style="display:none"></div>
<textarea name="presentation" onkeyup="myFunction(this)"></textarea>
</body>
<style>
#preview{
width:200px;
height:auto;
border:1px solid black;
}
</style>
Hope this is the answer to your question.
Related Query
- Posting data without refresh + calling another jquery function
- reload php generated table without page refresh
- Live Search with PHP and MySQL without page refresh
- calling javascript function from php form submit
- calling a function from another JavaScript file without eval()
- calling for javascript function in php form
- Count() function updates after page refresh php
- Passing a var in the same php page without refresh
- Calling a Function in PHP file, using AJAX, with an ID specific to a record in Database to update record
- Calling PHP function wth HTML button
- Ajax calling multiple php files in same function
- Calling a php function in external file is not responding
- Calling jquery function after certain php script with parameters
- refresh page with ajax jquery without use of reload function
- Submit form in div with ajax, return php in div without refresh
- Do html validation without calling javascript function on submission of form.
- How to pass form data to PHP using Ajax and display error messages with jQuery without page refresh
- Calling PHP function file from Ajax
- Including imagegrabscreen php function to a button onclick without refreshing the page
- Sending some data from jQuery, calling function that is in PHP by setInterval
- calling ajax function for every Iteration of a foreach loop without any submit button
- PHP and JQuery Function Calling Repeated
- Calling PHP variable as function value
- Calling Code-Behind function from AJAX directly without page load
- Calling a php function unsing jquery goes wrong
- Using a php script to verify age of a visitor and loading an iframe based on result without refresh
- how to auto refresh multiple php variables without refreshing page? I can only do one atm
- Calling a php function with ajax
- How to check if any one value not equals and stop calling function within each function using jquery?
- Calling a single function from the YouTube Player API?
- jquery sum is not working, when calling the function the sum changes to zero
- dysfunctional jQuery function without any clue in Chrome console
- Call php function with onclick event?
- Unexpected end of input error while calling javascript function on click of a link in dropdown menu
- Function not calling from body page
- WooCommerce function with Jquery and inside it PHP
- AJAX function call on submit button not working in PHP CodeIgniter
- Calling Mobile Menu Function on Window Resize
- Refresh pulled data from json PHP
- Prevent people from sending multiple forms without page refresh
- Jquery this returns empty object when calling from another function
- JavaScript function not being called after Partial View refresh
- Access jQuery Object After Calling Initial Function
- click subscribe/unsubscribe button more than once without having refresh whole page
- Uncaught TypeError: $(...).DataTable is not a function on calling 3 different tables on same page with autorefresh
- Calling a JS function within jQuery(mousedown)
- Submit a form with a file without refresh
- $() is not a function on calling modal dialog google map resize
- Calling a js function throught html is causing errors
- Calling a JQuery function onClick
More Query from same tag
- Vertically centering a div spills over
- Bootstrap Carousel Not Working loaded from CDN
- Cannot get Data Attribute after set Data Attribute
- load jquery htmlbox with ajax
- How to auto scroll to bottom with auto refresh in jquery
- how to access specific div association with a image
- Why a variable value deletes in js file. when I open jquery fancy box?
- jQuery change() fires on Page Load
- Binding multiple viewmodel in knockout.js
- Ajax Div Loader: UberGallery not working through Ajax
- jquery cookie variable is not getting updated
- Changing open graph meta tags with jQuery
- How to perform search and sort on dynamically populate DataTable
- How do i fade in and out a color change for a div?
- Parsing A String Of A Particular Format
- Part of my jquery is missing!
- Creating a dropdown without using a select box
- Ruby on Rails - Update collection_select while filling out the form
- How to make the screen follow the Slidetoggle
- jQuery cut out content between 2 tags
- Execute a function in JQuery after 2 functions were finished
- GET request not returning data on success
- Why is smooth scrolling not working?
- GalleryView - JQuery With Landscape and Portrait Photos
- How can I change my regular filter form using a submit, to use AJAX?
- Filtering array on multiple options to return options in new select
- Web page becomes unresponsive after ajax call
- responsive navigation using query
- SlickGrid: sorting after reordering doesn't work
- putImageData() draws scaled version of desired image to canvas, rather than 1:1