Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strip html

Status
Not open for further replies.

MAWarGod

Programmer
Feb 15, 2002
352
0
0
US
Code:
<script type="text/javascript">
            $('document').ready(function(){
                var url = '<?php echo $_SERVER['PHP_SELF'];?>';
                var timestamp = 0;
                var interval = 5000;
                var first = true;
                $('#formChatForm').bind('submit', function(e){
                    e.preventDefault();
                    $.post(url,$(this).serialize() + '&action=writeChatData', function(d){update();},'json');
                    if(first && $('input[name="chatPerson"]').val() != ""){
                        $('input[name="chatPerson"]').replaceWith($('<span>'+ $('input[name="chatPerson"]').val() + '</span>'));
                    }
                    return false;
                });
                var update = function(){
                    $.post(url, 'action=getChatData&timestamp='+timestamp, function(d){
                            timestamp = d.timestamp;
                            $('#chatTable').prepend(d.chatText);
                    }, 'json');
                }
                var timer = setInterval(update, interval);
                update();
            });
        </script>

hello I was wondering if there is a way to strip the html from
Code:
                   if(first && $('input[name="chatPerson"]').val() != ""){
                        $('input[name="chatPerson"]').replaceWith($('<span>'+ $('input[name="chatPerson"]').val() + '</span>'));

thanks in advance


MA WarGod

I believe if someone can think it, it can be programmed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top