I am looking to escape all code within the <pre>
tags so I can display it to the browser.
Here is what I am trying to do...
<pre><code>
Code below
<?php
if ( $is_iphone ) { ?>
<meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" />
<?php } ?>
</pre></code>
I am looking to use jQuery to do this. Is there a function?
So the output would be.
<pre><code>
Code below
<?php
if ( $is_iphone ) { ?>
<meta name开发者_JAVA百科="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" />
<?php } ?>
</pre></code>
Can you do this with jQuery?
Here is my code.
<script type="text/javascript">
$(function()
{
$("#teatarea").keyup(function()
{
var textarea=$(this).val();
// I can change this function to text instead of HTML but I need the <pre> tags to stay as HTML to display to the browser???
$(".addesc1").html(textarea);
return false;
});
});
</script> `
HTML:
<div id="dis" class="addesc1">
Description Line 1
</div>
as you have asked for the textarea with php i have done it here is the demo http://fiddle.jshell.net/3y4qA/1/
you cannot retrive php with jquery as you have asked but you can try to post it via ajax and get the value
精彩评论