Advertisement

03.12.2008 at 10:42AM PDT, ID: 23235994
[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!

9.9

JS how to get the complete paramlist

Asked by thordk in JavaScript

i want to make a web-page have ajax capeabillities so it updates every 1 second.

I have this page called result.php (code attached here) - which really is a middlestation calling the real page, reportresult.php

What i want to do is get the complete parameter-line that this page is called with (result.php) and pass this on through the function:

function sendRequest()
{
  var url="http://localhost/report/reportresult.php"
  url=url+document.params
  http.open('get', url);
  http.onreadystatechange = handleResponse;
  http.send(null);
}

But this doesnt work at all - its just "undefined" - whats the variable for this ?

I have posted the complete code below.

Please note: i am a total noob and im just trying to achieve this by putting bits and pieces together.
Start 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:
75:
76:
77:
78:
79:
<script type="text/javascript">
 
function createRequestObject() 
{ 
  var req; 
  if (window.XMLHttpRequest) 
  { // Firefox, Safari, Opera... 
    req = new XMLHttpRequest();  //    alert('Detected a modern browser - very good!'); 
  } 
  else 
  if (window.ActiveXObject) 
  { // Internet Explorer 5+
    req = new ActiveXObject("Microsoft.XMLHTTP");  //    alert('Detected an old IE browser'); 
  } 
  else 
  { 
    // error creating the request object, 
    // (maybe an old browser is being used?)
    alert('There was a problem creating the XMLHttpRequest object'); 
    req = '';
  }
  return req; 
} 
     
// Make the XMLHttpRequest object 
var http = createRequestObject(); 
     
function sendRequest() 
{ 
  var url="http://localhost/report/reportresult.php"
  url=url+document.params
  http.open('get', url); 
  http.onreadystatechange = handleResponse; 
  http.send(null); 
} 
     
function handleResponse() 
{ 
//  if(http.readyState == 4 && http.status == 200)
 
  if(http.readyState == 4)
  { 
    var response = http.responseText; // Text returned FROM perl scrip+t 
    if(response) 
	{ // UPDATE ajaxTest content 
      document.getElementById("ajaxstuff").innerHTML = response; 
      setTimeout('doclick()', 1000); // wait 2 seconds, then clear mes+sage
    } 
  } 
} 
 
function wipeout() 
{
  document.getElementById("ajaxstuff").innerHTML = ''; 
  x = document.getElementById("mybutton");
  x.disabled = false;
}
 
function doclick() 
{
  x = document.getElementById("mybutton");
  x.disabled = true;
 
//  document.getElementById("ajaxstuff").innerHTML = 'working...'; 
  sendRequest();
  return true;
}
 
</script>
</head>
<body>
<hr/> 
<p><em><div id="ajaxstuff" > &nbsp; </div></em></p>
<form><input type="button" id="mybutton" onClick="doclick()" value="Go!"></form>
<hr/> 
</body> 
<body onload="doclick();">
 
</html>
[+][-]03.12.2008 at 11:03AM PDT, ID: 21108918

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.

 
[+][-]03.13.2008 at 05:12AM PDT, ID: 21115284

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.

 
[+][-]03.13.2008 at 06:36AM PDT, ID: 21115996

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.

 
[+][-]03.13.2008 at 11:57AM PDT, ID: 21119536

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

Zone: JavaScript
Sign Up Now!
Solution Provided By: b0lsc0tt
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.13.2008 at 12:28PM PDT, ID: 21119900

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.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628