Advertisement

10.13.2008 at 11:55AM PDT, ID: 23810470
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Works in IE but not in firefox. Why

Asked by syedasimmeesaq in Asynchronous Javascript and XML (AJAX), JavaScript, PHP Scripting Language

I have this function below and problem is that the code below will not work in Firefx but it works in IE. However if I take out this part from the code below


 switch( true )
      {
            case document.getElementById('NC1').checked: url +="&NC=1"; break;
            case document.getElementById('NC2').checked: url +="&NC=2"; break;
            case document.getElementById('NC3').checked: url +="&NC=3"; break;
            case document.getElementById('NC4').checked: url +="&NC=4"; break;
            case document.getElementById('NC5').checked: url +="&NC=5"; break;
            case document.getElementById('NC6').checked: url +="&NC=6"; break;
            case document.getElementById('NC7').checked: url +="&NC=7"; break;
      }
      url+="&NC_notes="+encodeURIComponent(document.getElementById('NC_notes').value)


then it works in both. How can I reaarange the code to work in IE and firefox.
ThanksStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
function ajaxFunction(element){
	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("Please update your browser!");
				return false;
			}
		}
	}
	var url="mainsurvey.php?T=" + encodeURIComponent(document.getElementById('T').value) 
	
		switch( true )
      {
            case document.getElementById('PC1').checked: url +="&PC=1"; break;
            case document.getElementById('PC2').checked: url +="&PC=2"; break;
            case document.getElementById('PC3').checked: url +="&PC=3"; break;
            case document.getElementById('PC4').checked: url +="&PC=4"; break;
            case document.getElementById('PC5').checked: url +="&PC=5"; break;
            case document.getElementById('PC6').checked: url +="&PC=6"; break;
            case document.getElementById('PC7').checked: url +="&PC=7"; break;
      }
 
      url+="&PC_notes="+encodeURIComponent(document.getElementById('PC_notes').value);
      
      switch( true )
      {
            case document.getElementById('NC1').checked: url +="&NC=1"; break;
            case document.getElementById('NC2').checked: url +="&NC=2"; break;
            case document.getElementById('NC3').checked: url +="&NC=3"; break;
            case document.getElementById('NC4').checked: url +="&NC=4"; break;
            case document.getElementById('NC5').checked: url +="&NC=5"; break;
            case document.getElementById('NC6').checked: url +="&NC=6"; break;
            case document.getElementById('NC7').checked: url +="&NC=7"; break;
      }
	url+="&NC_notes="+encodeURIComponent(document.getElementById('NC_notes').value)
	+ '&element=' + element;
 
	ajaxRequest.open("GET", url, true);
    ajaxRequest.onreadystatechange = function(){            
      switch(ajaxRequest.readyState) {
        case 4:
        if(ajaxRequest.status!=200) {
            alert("Error:"+ajaxRequest.status); 
        }else{
        	var xml = ajaxRequest.responseXML;
            var updateElement = xml.getElementsByTagName("element")[0];
            document.getElementById('update' + updateElement.firstChild.nodeValue).innerHTML = '<img src="img/greencheck.jpg" height="20" width="20" alt="Updated">';
        }
        break;
 
        default:
            return false;
        break;     
    }
  };	
	ajaxRequest.send(null);
 
 
 
}
function changeColor(obj,color){
obj.style.backgroundColor = color;
}
//-->// JavaScript Document
[+][-]10.13.2008 at 01:14PM PDT, ID: 22705975

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 01:48PM PDT, ID: 22706320

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 01:49PM PDT, ID: 22706331

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 12:23AM PDT, ID: 22709200

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 02:31PM PDT, ID: 22716193

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 03:18PM PDT, ID: 22716555

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.15.2008 at 12:02AM PDT, ID: 22718559

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.17.2008 at 10:13PM PDT, ID: 22747151

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Asynchronous Javascript and XML (AJAX), JavaScript, PHP Scripting Language
Sign Up Now!
Solution Provided By: routinet
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628