|
הרשם | ![]() |
שאלות ותשובות | ![]() |
רשימת חברים | ![]() |
לוח שנה | ![]() |
הודעות מהיום | ![]() |
חיפוש | ![]() |
|
![]() |
|
כלים לאשכול | תצורת הצגה |
![]() |
# 1 |
חבר על
|
ajax|ירידת שורה בתיבת textarea
שלום לכולם,
יש לי בעיה ממש מוזרה עם textarea. אני מנסה לעדכן נתונים במסד עם תיבת טקסט ללא רענון. הכל מתעדכן טוב רק שכל תווי הירידת שורה פשוט נעלמים (תגי ה \n). אגב בהתחלה חשבתי שהבעיה היא פה: HTML קוד:
// evaluate javascript scriptTag='(<script.*?>)((\n|\r|.)*?)(<\/script>)'; if (scripts=resultsuser.match(scriptTag)) { // remove slashes scripts[2]=scripts[2].replace(/\\/g,""); //run scripts eval(scripts[2]); } קוד html: HTML קוד:
<form name='Login'> <textarea cols="91" rows="15" id="ContentMessage"><tag:Content messages admins.Content /></textarea> <br /> <input type='button' class="button" value="עדכן" onclick='AjaxUpdateDiv("MessageAdmins","ajax/ajax_index.php","?ContentMessage="+ document.getElementById("ContentMessage").value);' /> <input type="button" class="button" value="בטל" onclick='AjaxUpdateDiv("MessageAdmins","ajax/ajax_index.php","?ajax=cancel")' /> </form> HTML קוד:
//Browser Support Code function AjaxUpdateDiv(DivUpdate,PageOpen,get) { var ajaxRequest; // The variable that makes Ajax possible! try { // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e) { // Internet Explorer Browsers try { ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function() { if(ajaxRequest.readyState == 4) { var ajaxDisplay = document.getElementById(DivUpdate); ajaxDisplay.innerHTML = ajaxRequest.responseText; resultsuser = ajaxRequest.responseText; // evaluate javascript scriptTag='(<script.*?>)((\n|\r|.)*?)(<\/script>)'; if (scripts=resultsuser.match(scriptTag)) { // remove slashes scripts[2]=scripts[2].replace(/\\/g,""); //run scripts eval(scripts[2]); } } } ajaxRequest.open("GET",PageOpen + get, true); ajaxRequest.send(null); }
__________________
קארדניה - משחק דפדפן ישראלי חדשני |
![]() |
חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים) | |
|
|