הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 24-06-09, 16:41   # 1
Megnum
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: May 2007
מיקום: אשד
הודעות: 1,308

Megnum לא מחובר  

בעיה | שגיאה רק ב6 בajax

שלום אני משתגע ויושב על זה כבר שעות יש בעיה רק בIE ושהאג'קס רצה השיגאה document doesnt support this property or method מופיעה בשורת השגיאה של אקפלורר והוא לא פועלת ואילו רק שעושים רענן היא פועלת מצויין ובFF אין בכל בכלל בעיות

אשמח אם משהו יכול לפתור לי את זה אפילו עם תמורה . תודה ושוב תוודה!
חלקי קוד הרלבנטיים(HTML):

HTML קוד:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html dir="rtl" xmlns="http://www.w3.org/1999/xhtml" lang="he">
<head>

<script language="javascript" src="functions.js" type="">
</script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="skin.css" type="text/css" />
<title>Imlaugh</title>
</head>
<body onload="body_load();">





<form name="mycomment" class="comment" action="javascript: add_comment();">
&nbsp;&nbsp; שם מלא<br /><input type="text" name="name"  id="name" class="typs"/>
&nbsp;&nbsp;&nbsp;תוכן התגובה<br /><textarea class="content" name="comment" id="comment"></textarea>
<input class="send" name="submit" type="submit" value="שלח תגובה" align="left" onclick="javascript: sendRequest();"/>
</form>


קובץ הגאווה סקריפט
קוד:
function createXMLHttpRequest() {
 var ua;
 if(window.XMLHttpRequest) {
 try {
  ua = new XMLHttpRequest();
 } catch(e) {
  ua = false;
 }
 } else if(window.ActiveXObject) {
  try {
	ua = new ActiveXObject("Microsoft.XMLHTTP");
  } catch(e) {
	ua = false;
  }
 }
return ua;
}


//add comment
function add_comment()
{			
		document.getElementById("alert").style.display="inline";
 

	 a=document.getElementById("name").value;
	 b=document.getElementById("comment").value;

	 
	  
	  if (a !=="" || b!=="") {
	  			document.getElementById("add_comment").style.display="none";
	  	
	  }
      

req.open("Get", "add_comment.php?name="+a+"&comment="+b); 
    req.onreadystatechange = handleResponse;  
    req.send(null);
} XMLHttpRequest

function handleResponse() {
 if(req.readyState == 4) 
 {
 var response = req.responseText;
  document.getElementById("alert").innerHTML = response; 
 }
 
 body_load()
}


//called to comments
function body_load()
{			

req2.open("Get", "comments.php?id=3"); 
    req2.onreadystatechange = handleResponse2;  
    req2.send(null);
} XMLHttpRequest

function handleResponse2() {
 if(req2.readyState == 4) 
 {
 var response = req2.responseText;
  document.getElementById("comment_sent").innerHTML = response; 
 }
 

}
  Reply With Quote
ישן 24-06-09, 19:44   # 2
Shay Ben Moshe
משתמש - היכל התהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2007
הודעות: 1,397

Shay Ben Moshe לא מחובר  

היי,
תחליף את:
קוד:
function createXMLHttpRequest() {
 var ua;
 if(window.XMLHttpRequest) {
 try {
  ua = new XMLHttpRequest();
 } catch(e) {
  ua = false;
 }
 } else if(window.ActiveXObject) {
  try {
	ua = new ActiveXObject("Microsoft.XMLHTTP");
  } catch(e) {
	ua = false;
  }
 }
return ua;
}
ב:
קוד:
function getXMLHttp() {
 var ua;
 try {
  //Firefox, Opera 8.0+, Safari
  ua = new XMLHttpRequest();
 }
 catch(e) {
  //Internet Explorer
  try {
   ua = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e) {
   try {
    ua = new ActiveXObject("Microsoft.XMLHTTP");
   }
   catch(e) {
    return false;
   }
  }
 }
 return ua;
}
בהצלחה!
__________________
שי בן משה - בונה אתרים
חותך אתרים, ומתכנת צד לקוח וצד שרת.
  Reply With Quote
ישן 26-06-09, 00:36   # 3
Megnum
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: May 2007
מיקום: אשד
הודעות: 1,308

Megnum לא מחובר  

תודה ידידי! החםלתי את הקידוד של הקובץ PHP וזה הסתדר איזה דפוק זה.
הוספתי גם את הקוד שלך וזה דווקא עובד עם כל הקידודים שהגדרתי. תודה רבה על העזרה
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 09:52.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ