Wow, its been years since i was last here. I love the layout of the site now - great job
I was tasked with streamlining our client-side support area. The way i have it now is this:
The page is displayed with all the user's open and closed tickets
user clicks on the topic via url link
a new tab or window opens with the information displayed
I need to change this so that when the person hits a button, the ticket opens on the existing page. Once they answer it or do whatever to it, the ticket will close and the page goes back to displaying tickets again.
I don't have much code at all, other than a div and the httprequest code. I don't really use javascript at all, other than the occassional script i get from other sites. I know i may not be able to do what i'm trying to discribe, i'd be happy if i could i pre-load the form in a collapsed box, then have ajax get the information needed and load it into the appropriate areas. Any help would be greatly appreciated.
I finished an encrypted-note, Version fetch, for my site using AJAX. The button is a little title within a <div id=vdiv>.
Here is the callback function I setup for AJAX. I got it to call Flist2 with the "data" it received. Flist2 happens to be the third stage of a finite state machine to control the sequence.
Getting the data isn't the issue, i use something similar already to put a pre-defined template into a textarea. The problem is how to have the div hidden, then open automatically, and then close again after the ticket is submitted or closed.
I use this script
Code:
<script language="javascript" type="text/javascript">
<!--
//Browser Support Code
function ajaxFunction(){
var ajaxRequest;
try{
ajaxRequest = new XMLHttpRequest();
} catch (e){
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;
}
}
}
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('n_answer');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
var a_id = document.getElementById('danswer').value;
var queryString = "?a_id=" + a_id;
ajaxRequest.open("GET", "ajax_query.php" + queryString, true);
ajaxRequest.send(null);
}
//-->
</script>
I use the containing div of the button to process all the action. The AJAX submit buttons disappear on a single request which saves writing multi-threading AJAX requests.
If your buttons remain visible I sugggest synchronous calls to the server via AJAX.
Bookmarks